How we can plot time Vs data, with 10mins interval? Time is12hrs only i.e. starting from 7AM to 7PM on x-axis.

Struggling to plot time Vs data with 10mins interval i.e. 72 reading for a day. Starting time 7AM upto 7PM, i.e. selected 12hrs only for some particular date only.

답변 (1개)

figure
axishandle = gca;
plot(datenums_of_relevant_times,data)
set(axishandle,'XTickLabels',datestr(get(axishandle,'XTick'),desired_format))
Supply your own vector of "datenum" and the "desired_format" of your time strings.

댓글 수: 2

Hello Lain,
Partially I resolved my problem. Thanks for that. But, if I want to strictly to plot 7AM as starting point and 7PM as end point, of x-axis. (At present, provided code didnot showing time for 12hrs only with 10mins interval). Also need to show 10mins interval data on x-axis. Then how I get these times to show on x-axis? (This looks meaningful plot if my axis is strict to said point.) Thanks again for quick answer.
set(axishandle,'XTick',listofdatenumsthatyouwantshowed)
axis([xleft, xright, ybottom, ytop])

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

질문:

2013년 8월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by