plot with dates on matlab

Hi All, I have some historical time series prices for some assets in a matrix of size 295x34. (Matrix called Absy)
Also I have the corresponding 295 dates in another matrix (295x1) called dates. The dates are in the format of 20060606 20060613 etc (weekly).
I want to plot Absy but with the x axis being the corresponding dates.
When I do plot (dates,Absy) I get a wrong graph. Could someone help me.

댓글 수: 1

Jan
Jan 2012년 7월 16일
Is 20060606 a number or a string?

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

 채택된 답변

the cyclist
the cyclist 2012년 7월 16일

0 개 추천

One way:
Convert to a MATLAB serial date first, using datenum()
d = datenum('20060606','yyyymmdd')
then plot, and use the datetick() function.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

질문:

2012년 7월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by