Store only numbers from user input
古いコメントを表示
Hi guys
Is there a way to store only the numbers from lets say an input of the type S^2+67*s+98
採用された回答
その他の回答 (1 件)
Jan
2011 年 12 月 1 日
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 件のコメント
Raldi
2011 年 12 月 1 日
Raldi
2011 年 12 月 1 日
Walter Roberson
2011 年 12 月 1 日
Answered in your newer question.
カテゴリ
ヘルプ センター および File Exchange で Data Type Identification についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!