I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

Más respuestas (1)

Jan
Jan el 6 de Oct. de 2013

0 votos

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

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Preguntada:

el 6 de Oct. de 2013

Respondida:

Jan
el 6 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by