Timeseries data in Matlab
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
JESUS DAVID ARIZA ROYETH
le 19 Nov 2019
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 commentaires
JESUS DAVID ARIZA ROYETH
le 19 Nov 2019
Modifié(e) : JESUS DAVID ARIZA ROYETH
le 8 Déc 2019
these zeros are the minutes and seconds that are set to 0 by default, please formally accept my answer.
Voir également
Catégories
En savoir plus sur Time Series dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!