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

3 Ansichten (letzte 30 Tage)
Mini Me
Mini Me am 13 Mai 2014
Kommentiert: Mini Me am 13 Mai 2014
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

Antworten (1)

Dishant Arora
Dishant Arora am 13 Mai 2014
filedir(cnt).date is a character string. Use datenum
datenum(filedir(cnt).date)
  3 Kommentare
Dishant Arora
Dishant Arora am 13 Mai 2014
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 am 13 Mai 2014
not working..graph comes up as a vertical line because of how closed the dates are....

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by