How do I get the second return value from a function without using temporary variables?

not that i know of. subsref doesn’t seem to work in this case, possibly because the second variable isn’t even returned from the function.

since matlab 2009b it is possible to use the notation

[~, b] = function(x) 

if you don’t need the first argument, but this still uses a temporary variable for b.

Leave a Comment