If I call my own function with not enough input arguments MATLAB realizes this not until the missing variable is used.
Example:
function d = inputErrorCheck(a,b,c)if a > b d = a+b;else d = a+c;end; end
Output:
>> inputErrorCheck(3,2)
ans = 5
>> inputErrorCheck(2,3)
Not enough input arguments.
Error in inputErrorCheck (line 6) d = a+c;
Is there a setting or something to get MATLAB to check the amount of input arguments before it starts the function?
Thanks!
Best Answer