필터 지우기
필터 지우기

Plotting data as a function of time

조회 수: 8 (최근 30일)
jacob Mitch
jacob Mitch 2019년 10월 13일
댓글: jacob Mitch 2019년 10월 14일
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
Stephan
Stephan 2019년 10월 13일
you are right, whats the question?
jacob Mitch
jacob Mitch 2019년 10월 14일
편집: jacob Mitch 2019년 10월 14일
The question says to create an array containing the integers from 1 to numberofdays and then use this as a time axis. The question then says plot prices as a function of time. I got prices from a table of data, as the first column x(:,1). Thanks again

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

채택된 답변

dpb
dpb 2019년 10월 13일
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.
  댓글 수: 1
jacob Mitch
jacob Mitch 2019년 10월 14일
The question says to create an array containing the integers from 1 to numberofdays and then use this as a time axis. The question then says plot prices as a function of time. I got prices from a table of data, as the first column x(:,1). Thanks again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by