Timeseries data in Matlab

Hello.
I have data in a textfile.
There are five variables in columns.
  1. Date in Years - 2015 to 2018
  2. Time in Months (0 - 12)
  3. Time in Days - (0 - 30 or 31 depending on length of the month)
  4. Time in Hours (0 - 23)
  5. Wind speed recorded at every hour (0 - 23) for every day.
I want to make a timeseries plot to show the temp (on y axis) and time on x-axis for the period 2015 to 2018.
How can I do this? What functions do I need to do this?
Thank you.

3 件のコメント

Adam Danz
Adam Danz 2019 年 11 月 12 日
編集済み: Adam Danz 2019 年 11 月 12 日
Without know much about the text file, I'd start with readtable() to read in the data from the text file.
Then I would use datetime() to convert your years/months/days/hours into datetime format.
Then you can just use plot(datetimeValues, WindSpeeds) to show your data.
If you get stuck, leave a comment with your code and an explanation of where you're stuck and I'd be glad to help further.
John D'Errico
John D'Errico 2019 年 11 月 12 日
Start by learning MATLAB. That is, read the getting started tutorials, since these are pretty basic questions.
That is, you need to read in your data. textread might be a good place to start.
Then, convert it to a single time variable. datetime might be a good idea here.
Finally, plot. A good place to start there is the function plot.
Sarah Yun
Sarah Yun 2019 年 11 月 12 日
Hello!
A = readtable('textfilename')
% This produces a table.
% 4 columns of this table relate to time: year, month, day, hour
t = datetime(Y,M,D,H,MI,S)
How should I use these 4 columns in the datetime function above?
Thank you.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series Events についてさらに検索

タグ

質問済み:

2019 年 11 月 12 日

コメント済み:

2019 年 11 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by