neely615 0 Newbie Poster

First off, I realize there isn't a specific Matlab subsection, but I hope someone will still be able to help.

I have been exchanging m-files with some folks, and one of the people using them is constantly having issues because they don't specify output arguments for given functions. I was thinking I could use the nargout to figure out when this occurs, i.e. if (nargout<1), but I can't seem to find anyway to then specify an output argument. Of course at the end of the function the output is stored in the ans variable in the workspace which is fine considering there is only one output argument possible, but what if there were more?

Simplified Example

function [auc,minMC]=roc(dt)

if (nargout<1)
     %specify auc and minMC as output argument variables
end

%function calculates roc and then returns an array of values for auc and an array for minMC

I can figure out how to us assignin to make a variable in the workspace, but then I can't fill the variable. To me this sounded like the easiest approach.

Any help would be much appreciated.