Timeseries data in Matlab
3 次查看(过去 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).
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!