plot date/time from matrix

조회 수: 1 (최근 30일)
Sharon
Sharon 2012년 5월 27일
I have matrix as follows:
'12-Jan-2012 14:22:00' [10]
'12-Jan-2012 14:23:00' [12]
'12-Jan-2012 14:24:00' [13]
I need to plot column 1 against column 2. Any help will be appreciated..

채택된 답변

Thomas
Thomas 2012년 5월 27일
I guess u need:
a={'12-Jan-2012 14:22:00' 10
'12-Jan-2012 14:23:00' 12
'12-Jan-2012 14:24:00' 13};
c=datenum(a(:,1),'dd-mmm-yyyy HH:MM:SS');
plot(c,cell2mat(a(:,2))) % the mat2cell will only be required if you do not have double in column 2
datetick('x')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by