Is is possible to check if a function gets called with to-be-ignored output arguments (using ~)?
function [Y1, Y2] = MyFunction(...)% common code for Y1 and Y2 here
if //insert_check_here// % avoid this code when called as [~, B] = MyFunction (...)
end
For all these situations below, however, nargout returns 2, so that function seems to have no use in solving my problem.
[~,b] = myFunction[a,~] = myFunction[~,~] = myFunction % you may think about the usefulness of this call :)
Thanks! ~ Jos
Best Answer