Read Data
1 回表示 (過去 30 日間)
古いコメントを表示
I need to read a file .txt with this format...
1945; 6937;N;000 1946; 6976;N;000 1947; 6987;N;000
how i can read these data i dont know a lot about the sintaxis, pls help and i want plot the year 1945 and the level 6937 Perform linear regression and plot the trend data.
and finally Calculate the slope of the trend.
5 件のコメント
採用された回答
Walter Roberson
2012 年 5 月 14 日
Try
fid = fopen('YourFile.txt', 'rt');
C = textscan(fid, '%f;%f;%*c;%*f', 'CollectOutput', 1);
fclose(fid);
Y = C{1}(1:2:end);
L = C{1}(2:2:end);
plot(Y, L)
3 件のコメント
Walter Roberson
2012 年 5 月 15 日
Hmmmm, maybe the CollectOutput would not be appropriate here, and instead
Y = C{1}; L = C{2};
Better test to be sure.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!