Borrar filtros
Borrar filtros

convert text like '(18)' to number

1 visualización (últimos 30 días)
Stewart Smith
Stewart Smith el 8 de Nov. de 2019
Respondida: Walter Roberson el 8 de Nov. de 2019
is there simple way to extract this text and convert to number?

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Nov. de 2019
S = '(18)';
value = sscanf(S, '(%f' )
You can get more complicated, like,
S = '(18,-3.8)';
value = sscanf(S, '(%f,%f)');

Categorías

Más información sobre Text Data Preparation en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by