MATLAB Answers

How to solve this error "Not enough input arguments."

15 views (last 30 days)
Tony Castillo
Tony Castillo on 14 Feb 2020
Commented: Tony Castillo on 17 Feb 2020
Dear all,
I have this code, though, I have previously defined all the variables, it still persist a message:
Not enough input arguments.
Error in Riesgo_C (line 2)
aux1 = V_in(V_in(:,12) == BATT,:);
The function:
function [deltaSOC] = Riesgo_C(V_in,BATT,PV,IRR)
aux1 = V_in(V_in(:,12) == BATT,:);
aux2 = aux1(aux1(:,11) == PV,:);
auxD = aux2(:,[2;4;6;8;10]);
auxI = aux2(:,[1;3;5;7;9]);
p = polyfit(auxI(1,:),auxD(1,:),1);
deltaSOC = polyval(p,IRR);
end
  2 Comments

Sign in to comment.

Accepted Answer

Jon
Jon on 14 Feb 2020
Your function requires 4 input arguments. You must have called it with less than 4 input arguments. Please check your code where you call the Riesgo function to make sure that you in fact have 4 input arguments. If you can not find the mistake, then please copy the exact code where you call the function and post it here.
  4 Comments
Jon
Jon on 14 Feb 2020
So then please copy and paste the command you are issuing to call it from the command line that produces the error. I think that you probably forgot to include one of the input parameters. You need to have 4.

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!