Timeseries data in Matlab
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have textfile .txt for temperature data over the past 50 years (attached as pic).
I want to plot it as timeseries data.
How can I do this?
What function should I use?
Thank you.
(Here is snippet of data. It goes on like this until year 2017).
(Smallest time unit is hour in 3 hour intervals)
(Temp is the dependent variable).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249040/image.jpeg)
0 件のコメント
回答 (1 件)
JESUS DAVID ARIZA ROYETH
2019 年 11 月 19 日
try it:
[filename,folder]=uigetfile('*.txt','please select your txt file');
a=readtable(fullfile(folder,filename));
time=datetime([a{:,2:5} zeros(size(a,1),2)]);
temp=a{:,6};
figure;
plot(time,temp)
3 件のコメント
JESUS DAVID ARIZA ROYETH
2019 年 11 月 19 日
編集済み: JESUS DAVID ARIZA ROYETH
2019 年 12 月 8 日
these zeros are the minutes and seconds that are set to 0 by default, please formally accept my answer.
参考
カテゴリ
Help Center および File Exchange で Time Series についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!