How to read Value from .txt
1 回表示 (過去 30 日間)
古いコメントを表示
Arun Kumar Singh
2020 年 6 月 15 日
コメント済み: Arun Kumar Singh
2020 年 6 月 15 日
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/316359/image.jpeg)
6 件のコメント
Walter Roberson
2020 年 6 月 15 日
編集済み: Walter Roberson
2020 年 6 月 15 日
fopen(), textscan() with headerlines 2, format '%*s%f%f%f', 'collectoutput', true, and count 1 (the count goes immediately after the format and before any other options.) cell2mat() the result of textscan() to get the numeric data. fclose()
採用された回答
Walter Roberson
2020 年 6 月 15 日
filename = 'File.txt';
fid = fopen(filename, 'rt');
GAL = cell2mat(textscan(fid, '%*s%f%f%f', 1, 'headerlines', 2, 'collectoutput', true));
fclose(fid);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Low-Level File I/O についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!