Possible Duplicate:
How to elegantly ignore some return values of a MATLAB function?
I have a Matlab function with two outputs. Sometimes I use both outputs.
function [output1 output2] = myFunction(input)
[a b] = myFunction(input);
Other times I only need output1 and don't want to waste memory assigning output2
a = myFunction(input);
However, I can't figure out a simple way to give the reverse scenario (only need output2 and don't want to waste memory assigning output1). I thought it would be something like
[~ b] = myFunction(input)
but that doesn't seem to work. Anybody have suggestions for a quick solution? Thanks for your help!