I'm struggling to understand the behaviour of nargout when used outside of a script. I have a testing function called addOne
function y = addOne(x);y=x+1;
with one output. I don't quite understand why nargout gives me too different outputs depending on how I pass the function handle:
>> nargout(@addOne)ans = 1>> nargout(@(x)addOne(x))ans = -1
What am I overlooking?
thanks in advance!
Daniel
Best Answer