I have a date data (dd.mm.yyyy HH:MM). After importing, the date data change into serial-date-numbers (729756). I use this type of data to plot. However, the type of data displaying at x-axis is serial-date-numbers type. Now I want my x-axis display as (dd.mm.yyyy HH:MM). I need your help. Thank you very much in advance

 채택된 답변

Star Strider
Star Strider 2017년 11월 4일

0 개 추천

The easiest approach is likely to use the datetick (link) function.

댓글 수: 4

I used this function, but it did not work. I don't know why.
plot(Datum,Q_Kempten,'b',Datum,Q_Sonthofen,'g')
datetick('x','dd.mm.yyy HH:MM')
grid on
xlabel('Datum (hour)')
ylabel('Discharge (m3/s)')
legend('Q Kempten','Q Sonthofen',-1)
Star Strider
Star Strider 2017년 11월 4일
Neither do I, because ‘did not work’ does not provide any relevant information. If your dates data are truly datenum serial numbers, that should work.
If you are actually reading it as a datetime (link) array, see the relevant documentation on datetime (link) arrays for details.
Linh Dinh
Linh Dinh 2017년 11월 6일
I did it thank you very much
Star Strider
Star Strider 2017년 11월 6일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기

질문:

2017년 11월 4일

댓글:

2017년 11월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by