string from a textbox
古いコメントを表示
hi. i want to extract 4,5,6,5 from string 4x^3 + 5x^2 + 6x^1 + 5
回答 (2 件)
str = '4x^3 + 5x^2 + 6x^1 + 5'
num = regexp(str,'(?<!\^)(\d)','match');
If you are using symbolic toolbox then you could use the appropriate function:
カテゴリ
ヘルプ センター および File Exchange で Operations on Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!