Is it possible to check whether the Matlab function output argument N is disgarded by its caller (~ given in call) or not provided one of its N+K, K>1, is defined, that is when nargout > N.
For instance, given
function [x,y] = f()
...;
end
we would like to detect that x does not need to be calculate by f() in the call
[~,y] = f();
Does not seem to be possible. See
this blog entry from the Matlab page in particular this comment.