This is a test function from the documentation. If I include a letter in the arguments instead of a number matlab reports an error. My question is how does matlab know its an error?
testValues(5,1,2,3,4,5,6,7,8,9,10,a)function testValues(threshold,varargin) minInputs = 2; maxInputs = Inf; narginchk(minInputs,maxInputs); for k = 1:(nargin-1) if (varargin{k} > threshold) fprintf('Test value %d exceeds %d\n',k,threshold) end %endif
end %endfor
end %end function
Thanks for any input, haha input get it!
D
Best Answer