importing data and plotting
古いコメントを表示
How can I load this txt file with some text at starting and numericals.I want to plot H,D,Z,F values aginst time see attached file plse

3 件のコメント
Mario Malic
2020 年 11 月 17 日
Import tool.
SHERIN ANN ABRAHAM
2020 年 11 月 17 日
Mario Malic
2020 年 11 月 17 日
https://www.mathworks.com/help/matlab/ref/importtool.html I would not know if 2007 has it.
採用された回答
その他の回答 (2 件)
Peter Perkins
2020 年 11 月 19 日
0 投票
In a more recent version of MATLAB, I would suggest to not use importdata. It's old and gives you a result that is hard to work with. I'd suggest readtimetable, or readtable in less recent versions.
In R2007? If you have the Statistics Toolbox, you could use the dataset function to read from a file.
There are very inexpensive versions of MATLAB for home use, I'd suggest you consider that. After all, your time is worth something, and a new version will save you time. Reading and plotting these data is two lines of code in a recent version.
Tyann Hardyn
2021 年 6 月 26 日
Try this :
filename = 'path of abg20000212dminn.txt';
startRow = 14;
formatSpec = '%10{yyyy-MM-dd}D%13s%4f%13f%10f%10f%f%[^\n\r]';
fileID = fopen(namafile,'r');
textscan(fileID, '%[^\n\r]', startRow-1, 'WhiteSpace', '', 'ReturnOnError', false, 'EndOfLine', '\r\n');
dataArray = textscan(fileID, formatSpec, 'Delimiter', '', 'WhiteSpace', '', 'TextType', 'string', 'EmptyValue', NaN, 'ReturnOnError', false);
DATE = dataArray{:,1};
TIME = dataArray{:,2};
DOY = dataArray{:,3};
ABGX = dataArray{:,4};
ABGY = dataArray{:,5};
ABGZ = dataArray{:,6};
ABGF = dataArray{:,7};
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
