Say I have a foo function defined as
[ab] = foo(c ).
If I consider a function descriptor
f = @(c)foo(c)
for use, for example. in the call to cellfun , what I get is f , acting equivalent to foo , defined as
a = foo(c)
i., returns the lost value of b .
Therefore, when such an f is placed in a call to cellfun , the output cell will only have a and will skip b (which I'm worried about right now). Visually
cellfun(f,input) [a(input{1})] ? [a(input{2})] ? .... b gets killed along the way
Question: how to define a function descriptor for foo that catches only b s? i.e. gives behavior similar to defining foo as
b = foo(c)
ie ^ 2, losing a s.
Also, is it possible to (efficiently) catch both a and b in a unique cellfun call?
matlab function-handle
Acorbe
source share