필터 지우기
필터 지우기

Not enough input arguments error

조회 수: 1 (최근 30일)
Samer Husam
Samer Husam 2012년 8월 28일
Hi all; I am plotting data from excel file by using MATLAB these data are:
x-Axis = time (from excel)
y-Axis = power (from excel)
but I am getting this error while plotting:
Not enough input arguments.
my code is :
[num,T,vT] = xlsread('Excel.xlsx','Sheet1'); % read excel
x= datestr(num(:,1),('HH:MM')); % time column
y = num(:,4); % power column
plot(handles.axes8,x,y);
why I am getting this error ? and how to solve it ?? please please help and advice... thank you very much
  댓글 수: 3
Image Analyst
Image Analyst 2012년 8월 28일
Don't paraphrase it. Copy and paste all, yes ALL, the red text.
Samer Husam
Samer Husam 2012년 8월 28일
this is the all red message:
??? Error using ==> plot Not enough input arguments.
Error in ==> simpletab>pushbutton1_Callback at 1600 plot(handles.axes8,x1,y);
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> simpletab at 18 gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback

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

채택된 답변

Samer Husam
Samer Husam 2012년 9월 5일
the problem been solved by using (datetick), as following code:
[num,T,vT] = xlsread('Excel.xlsx','Sheet1'); % read excel
x = num(:,1); % Time column
y = num(:,4); % power column
plot(handles.axes,x,y);
datetick(handles.axes8,'x',15)

추가 답변 (1개)

Samer Husam
Samer Husam 2012년 8월 29일
when I am using this code :
[num,T,vT] = xlsread('Excel.xlsx','Sheet1'); % read excel
x = num(:,1); % Time column
y = num(:,4); % power column
x1= datenum(x,'HH:MM');
plot(handles.axes8,x1,y);
I am getting this error:
??? DATENUM failed.
Error using ==> datenum at 103
The input to DATENUM was not an array of strings.
why this error is happen ??
  댓글 수: 3
Samer Husam
Samer Husam 2012년 8월 29일
I have tired this way before as well, but the error comes is :
??? DATENUM failed.
Error using ==> dtstr2dtnummx
Failed on converting date string to date number.
Walter Roberson
Walter Roberson 2012년 8월 29일
Your code in your original Question shows you passing part of "num" to datenum(), rather than passing part of "T" to datenum(). Have you tried with "T" ? Could you show an example string that you are passing to datenum() ?

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

카테고리

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