Extract numbers out of a .mat file that has both characters and numbers
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, How can I extract numbers out of this .mat file ? Thanks.
0 件のコメント
採用された回答
Azzi Abdelmalek
2015 年 7 月 17 日
編集済み: Azzi Abdelmalek
2015 年 7 月 17 日
a=regexp(text,'(?<==)\d+(.)?(\d+)?','match','once')
id=~cellfun(@isempty,a(:,1))
a=str2double(a(id))
2 件のコメント
Stephen23
2015 年 7 月 17 日
編集済み: Stephen23
2015 年 7 月 17 日
Standard scientific notation using "E" syntax does not use any multiplier symbol, so your source data is non-standard and therefore MATLAB does not recognize it. Therefore you basically have two choices:
- Change the source data to use standard E-notation.
- Read the data into MATLAB as strings, and then do some hackery using regexprep before converting to numeric.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!