How to format datastamp XTick in a Matlab plot to just hour:minute?
I tried to use
xtickformat('dd-MMM-yyyy')
But this function, appear, just to be present in the Matlab R2016b version.

댓글 수: 2

dpb
dpb 2016년 11월 28일
Which release are you using? What did you use for the time variable?
I am using the R2016a. The time variable (x-axis) is created as
Tsim = 60*60*24; % [s].
Tstep = 60*5; % [s].
time = 0:Tstep:Tsim;
timeStamp = timeStamp = datetime( datestr(time/(24*60*60),'HH:MM:SS'),'InputFormat','HH:mm:ss');
I am plotting data in function of timeStamp ( plot(timeStamp,Y1) ).

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

 채택된 답변

Hildo
Hildo 2016년 11월 29일

0 개 추천

I solved this, founding this function
datetick('x','HH:MM')
The is present in the R2016a version.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

태그

질문:

2016년 11월 28일

답변:

2016년 11월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by