Plotting time-series data

조회 수: 2 (최근 30일)
PIYUSH CHOUDHARY
PIYUSH CHOUDHARY 2019년 10월 9일
댓글: PIYUSH CHOUDHARY 2019년 10월 9일
I have an excel file from which I read the inputs corresponding to different months and years (from Jan,1901 to Dec, 2014). I used that input to get my output for these points in time.
The output i get is stored in the matrix named "PET". I have to plot these PET values on y-axis and the time stamps to which they belong on the x-axis.
I am attaching here the output matrix. (The first row are numbers for Jan 1901, second row for Feb 1901 and so on until Dec, 2014....The columns represent different places for which the input was given and output was to be calculated. Here I need to plot any one of the columns, say col 1, against the time stamps). Please offer me any help.
Regards,
Piyush
Screenshot (8).png
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2019년 10월 9일
Piyush - do you already have a 1368x1 column of timestamp data?
PIYUSH CHOUDHARY
PIYUSH CHOUDHARY 2019년 10월 9일
편집: PIYUSH CHOUDHARY 2019년 10월 9일
Yes. If you consider one of the columns, it has 1368 data (each corresponding to different time stamps). I do not know how to associate time stamps with these data values and get a timeseries plot.

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 9일
ts = datetime([1901, 1, 1]) + calmonths(0:size(PET,1)-1).';
plot(ts, PET(:,3)) %for example
  댓글 수: 1
PIYUSH CHOUDHARY
PIYUSH CHOUDHARY 2019년 10월 9일
Thank you so much, Sir. That works really as required.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by