Filter löschen
Filter löschen

Convert cell to matrix

1 Ansicht (letzte 30 Tage)
Martin Park
Martin Park am 6 Okt. 2013
Beantwortet: Jan am 6 Okt. 2013
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 6 Okt. 2013

Weitere Antworten (1)

Jan
Jan am 6 Okt. 2013
Faster than str2double:
C = {'128' '256' '157' '54'};
S = sprintf('%s*', C{:});
D = sscanf(S, '%g*');

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by