How to plot timeline in matlab?
11 ビュー (過去 30 日間)
古いコメントを表示
Hi, all,
I want to plot a figure with x-axis is timeline, for example, from 9am to 11pm, and every 10 or 15 minutes are one epoch. Does matlab provide some code for a timeline axis? Thanks.
0 件のコメント
採用された回答
Oleg Komarov
2012 年 8 月 16 日
% Create dates as serial numbers
serdates = fix(now) + 9/24 : 1/(24*4) : fix(now) + 11/24;
% plot
plot(serdates,rand(1,9))
% Set ticks to serial dates (just to make sure they fall on serdates)
set(gca,'xtick',serdates)
% Format into time
datetick('x','keepticks')
2 件のコメント
Azzi Abdelmalek
2012 年 8 月 16 日
Oleg, why fix(now)?
serdates = 9/24 : 1/(24*4) : 11/24;
is fine
Oleg Komarov
2012 年 8 月 17 日
If you wanna plot for multiple days you have to start somewhere, I chose now().
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Bar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!