Put a number from a header into a variable?
古いコメントを表示
I have a text file containing the value of a time step (in the header), which I want to assign to a variable. How can I extract this number (just the time step), since the header also contains words? I have provided the header below:
Lead Number 1 Time Step .001 Data Points 6001
回答 (1 件)
Azzi Abdelmalek
2016 年 7 月 13 日
編集済み: Azzi Abdelmalek
2016 年 7 月 13 日
s='Lead Number 1 Time Step .001 Data Points 6001 '
ts=str2double(regexpi(s,'Step\s*(\d?\.?\d+)','tokens','once'))
カテゴリ
ヘルプ センター および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!