Extract number on variable name.
2 ビュー (過去 30 日間)
古いコメントを表示
My variable name is Final_50000_run_1
Is there a way to extract the number 50000 and 1 out.
Thanks.
2 件のコメント
回答 (2 件)
Azzi Abdelmalek
2016 年 7 月 19 日
編集済み: Azzi Abdelmalek
2016 年 7 月 19 日
s='Final_50000_run_1'
regexp(s,'\d+','match','once')
If you want to extract all the numbers
regexp(s,'\d+','match')
0 件のコメント
Steven Lord
2016 年 7 月 19 日
Is this a variable name or a file name? If it is a variable name, I recommend you read question 1 in the Programming section of the FAQ for an explanation of why including data in your variable names is discouraged. If it is a file name, see Azzi's answer.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fortran with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!