MATLAB: How to solve this error “Not enough input arguments.”

argumentsMATLABvariable

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

Best Answer

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.