[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Discover ignored output arguments from inside function?
From: |
Judd Storrs |
Subject: |
Discover ignored output arguments from inside function? |
Date: |
Wed, 28 Jul 2010 21:02:27 -0400 |
Recently octave gained the ability to ignore output arguments. Is there currently any way to know whether a particular output is destined to be discarded from within the function? For example suppose:
function [a,b,c,d] = myfunc(e)
a = ....
b = ....
c = ....
d = ....
endfunction
If I call this like:
[a,~,~,d] = myfunc(e)
is there any way for myfunc() to know not to put too much effort into computing b and c? I can think of plenty of inelegant kludges that commit the sins of verbosity, fragility and complexity. What I'm looking for is something direct and automatic like
function [a,b,c,d] = myfunc(e)
if isignored("b")
b = ....
endif
if isignored(3)
c = ....
endif
...etc...
endfunction
--judd
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Discover ignored output arguments from inside function?,
Judd Storrs <=