I'd like to create a function that has a variable number of return arguments based on the value of a flag, having a fixed number of input parameters.
[out1, out2] = myFun(inp1, inp2, 'a'); [out1, out2, out3] = myFun(inp1, inp2, 'b');
I tried using varargout but haven't managed to successfully accomplish what I want to do.
Best Answer