Store only numbers from user input
Ältere Kommentare anzeigen
Hi guys
Is there a way to store only the numbers from lets say an input of the type S^2+67*s+98
Akzeptierte Antwort
Weitere Antworten (1)
Jan
am 1 Dez. 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 Kommentare
Raldi
am 1 Dez. 2011
Raldi
am 1 Dez. 2011
Walter Roberson
am 1 Dez. 2011
Answered in your newer question.
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!