convert text like '(18)' to number

1 vue (au cours des 30 derniers jours)
Stewart Smith
Stewart Smith le 8 Nov 2019
is there simple way to extract this text and convert to number?

Réponses (1)

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

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by