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).

댓글 수: 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!