Borrar filtros
Borrar filtros

Convert cell to matrix

1 visualización (últimos 30 días)
Martin Park
Martin Park el 6 de Oct. de 2013
Respondida: Jan el 6 de Oct. de 2013
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Oct. de 2013
str2double()

Más respuestas (1)

Jan
Jan el 6 de Oct. de 2013
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 Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by