how to write a character from a string?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi I didn't use commands for strings in matlab so i have a word like 'displacement22' and i want to write '22' from this string, so what would i do?
0 件のコメント
回答 (3 件)
Image Analyst
2013 年 2 月 2 日
s = 'displacement22' % Your string.
theNumber = sscanf(s, 'displacement%d') % Extract the number.
0 件のコメント
Azzi Abdelmalek
2013 年 2 月 2 日
編集済み: Azzi Abdelmalek
2013 年 2 月 2 日
s='displacement22' ;
out=s(regexp(s ,'[0-9]'))
%or
out=s(regexp(s ,'\d'))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!