Store only numbers from user input
Mostra commenti meno recenti
Hi guys
Is there a way to store only the numbers from lets say an input of the type S^2+67*s+98
Risposta accettata
Più risposte (1)
Jan
il 1 Dic 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 Commenti
Raldi
il 1 Dic 2011
Raldi
il 1 Dic 2011
Walter Roberson
il 1 Dic 2011
Answered in your newer question.
Categorie
Scopri di più su Data Type Identification in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!