??? Error using ==> plot Invalid first data argument
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Dishant Arora
2014-5-13
filedir(cnt).date is a character string. Use datenum
datenum(filedir(cnt).date)
3 个评论
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!