??? Error using ==> plot Invalid first data argument

조회 수: 2 (최근 30일)
Mini Me
Mini Me 2014년 5월 13일
댓글: Mini Me 2014년 5월 13일
filedir = dir('C:\Users\ValcourtA\Documents\WILMA\WILMA500Hz')
timerArray=[];
for cnt=1:5
battery=data(:,1)
timerArray=vertcat(timerArray,filedir(cnt).date)
plot(timerArray,Battery)
end
why do i get this error ??? Error using ==> plot Invalid first data argument

답변 (1개)

Dishant Arora
Dishant Arora 2014년 5월 13일
filedir(cnt).date is a character string. Use datenum
datenum(filedir(cnt).date)
  댓글 수: 3
Dishant Arora
Dishant Arora 2014년 5월 13일
make use of dateformnum , as a parameter to datetick
datetick('x' , 0 , 'keepticks') % after you plot.
for more information see the documentation of datetick.
Mini Me
Mini Me 2014년 5월 13일
not working..graph comes up as a vertical line because of how closed the dates are....

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

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by