Store only numbers from user input
Mostrar comentarios más antiguos
Hi guys
Is there a way to store only the numbers from lets say an input of the type S^2+67*s+98
Respuesta aceptada
Más respuestas (1)
Jan
el 1 de Dic. de 2011
Another approach from the times of Matlab 5.3 without REGEXP:
S = 'S^2+67*s+98';
S((S < '0' | S > '9') & S ~= '.') = ' ';
N = sscanf(S, '%g');
3 comentarios
Raldi
el 1 de Dic. de 2011
Raldi
el 1 de Dic. de 2011
Walter Roberson
el 1 de Dic. de 2011
Answered in your newer question.
Categorías
Más información sobre Data Type Identification en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!