Azzera filtri
Azzera filtri

Convert cell to matrix

1 visualizzazione (ultimi 30 giorni)
Martin Park
Martin Park il 6 Ott 2013
Risposto: Jan il 6 Ott 2013
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

Risposta accettata

Walter Roberson
Walter Roberson il 6 Ott 2013
str2double()

Più risposte (1)

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

Categorie

Scopri di più su Data Type Conversion in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by