plot with dates on matlab

1 Ansicht (letzte 30 Tage)
Mate 2u
Mate 2u am 16 Jul. 2012
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 Kommentar
Jan
Jan am 16 Jul. 2012
Is 20060606 a number or a string?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Financial Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by