How to change time interval in timeseries plot?

32 ビュー (過去 30 日間)
Ravindu Lokuliyana
Ravindu Lokuliyana 2019 年 5 月 23 日
コメント済み: per isakson 2019 年 5 月 27 日
Hi there,
I have timeseries dataset('Model_01') which need to plot in a timeseries. The values need to plot in 3 hours interval but the figure represents 1 hour interval. How can I change that into 3h intervals? Folllowing commands use for the plot.
% plot model data
ts_Model_01 = timeseries(Model_01);
ts_Model_01.TimeInfo.Units = 'hours';
ts_Model_01.TimeInfo.StartDate = {datestr(datenum(num2str(buoy_start_date),'yyyymmdd'))}; % Set start date.
ts_Model_01.TimeInfo.Format = 'yyyy-mm-dd HH:MM'; % Set format for display on x-axis.
ts_Model_01.Time = ts_Model_01.Time - ts_Model_01.Time(1); % Express time relative to the start date
colorstring_Model = 'k';
plot(ts_Model_01,'-','Color', colorstring_Model,'LineWidth',1.5)
Your help is much appreciated.

採用された回答

per isakson
per isakson 2019 年 5 月 23 日
編集済み: per isakson 2019 年 5 月 27 日
  2 件のコメント
Ravindu Lokuliyana
Ravindu Lokuliyana 2019 年 5 月 27 日
Hi,
Thank you for the answer.
But I didn't get the exact meaning of that.
Can you please explain it more?
per isakson
per isakson 2019 年 5 月 27 日
To use Matlab effectively it's neccessary know how to find information in the documentation. That's an art in itself. I added another link to my answer. Spend some time with the examples.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series Events についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by