Filename parsing

13 ビュー (過去 30 日間)
Matt
Matt 2011 年 6 月 20 日
I'm working withfiles names with some details in the name. Basically it is a series of files all with the same format
Prefix_number1_number2_number3_number4
Obviously this gets very annoying when trying to analyze one file after another.
How can I parse these names so I can call them from any of the parameters the number represent.
For example, if number1 represented an angle, is there a way I can seperate or call the files from that parameter?

採用された回答

Walter Roberson
Walter Roberson 2011 年 6 月 20 日
[prefix, number1, number2, number3, number4] = sscanf(TheFilename, '%[^_]_%f_%f_%f_%f');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by