Plotting data as a function of time
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jacob Mitch
am 13 Okt. 2019
Kommentiert: jacob Mitch
am 14 Okt. 2019
I'm just trying to understand plotting prices as a function of time, if I have price data of prices in a column, say x=[1;2;3;4;5;6;7;8;9;13;14;15] and creating a time axis of integers from 1 to the number of days so 1:length of the first colum am I correcting in the definition of plotting the prices as a function of time by.
numberofdays=size(x,1)
plot(1:numberdays,x(:,1)) %equivalent to plot(t,y) where x(:,1) are the first column price values
2 Kommentare
Akzeptierte Antwort
dpb
am 13 Okt. 2019
For the given description, yes. BUT, you should probably create your date vector as one of the datetime or duration class instead as just integers if there is anything excepting just arbitrary day sequence number in the time series. Most often, one only has economic data that is associated with an actual date.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Price and Analyze Financial Instruments 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!