dpb <email@example.com> wrote in message <firstname.lastname@example.org>... > On 7/10/2013 1:22 PM, Eric Sampson wrote: > ... > > > I must be being dense too ;) because didn't you already show in your > > example that you can use the ~ operator to ignore return values, like > > [~,~,c] = unique(a(:,3)); or am I misunderstanding your question? > > But I had to save c in order to pass it to the following invocation of > arrayfun(). > > It would be _a_good_thing_ since that's the only reason for c to not to > have to create it in the workplace or local context an have it hanging > around but rather to have it be a temporary by nesting the function calls. > > If it were u that were needed/wanted as the argument, then it could be done. > > Sometimes, if the function result is need more than once then it makes > sense to make the temporary to avoid repeated evaluations, of course > (there's where enhancing the optimizer comes in if it can recognize > common expressions and eliminate the second call or not). > > That help, hopefully? > > --
Ah yes, I think that now I understand what you were referring to. Oddly enough, I submitted an enhancement request recently that you might like, to allow a person to do something like this:
The temp variable can be named whatever you want, the crux of the enhancement request is to allow you to next function calls with multiple return arguments, as long as all but one return arg are ignored using ~.
If you like that idea, please email/call TMW support and let them know, so they add your vote to the enhancment request :)