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!