Help with plot function!
显示 更早的评论
I have a matrix of data named "D.data" and I can take sections of the matrix and assign them to a variable, like so:
A = D.data(:,89);
And I can plot two vectors taken from the initial data matrix like so:
plot(B,A)
However, when I want to take multiple rows from the starting matrix and combine them into one column vector, like this:
time = datestr(datenum(D.data(:,1:6)));
I cannot plot it anymore. It can be displayed like:
disp (time);
in which case it will display a list of times:
03-Dec-2011 05:28:36
03-Dec-2011 05:29:37
03-Dec-2011 05:30:38 ...
Why does "plot(time,A)" not work?
Here is the error it gives:
??? Error using ==> plot
Invalid first data argument
Error in ==> joan2>pushbutton1_Callback at 133
plot(time,Klystron);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> joan2 at 43
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)joan2('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Thank you in advance!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!