How can I access both arguments ismember
when it is used internally splitapply
?
slitapply
it returns only scalar values ββfor each group, therefore, to calculate non-scalar values ββfor each group (as was returned by the first argument ismemebr
), you need to enclose an anonymous function (in this case ismember
) inside curly braces {}
to return an array of cells.
But now, when I provide two output arguments splitapply
, I get an error message:
Output argument "varargout{2}" (and maybe others) not assigned during call to
"@(x,y) {ismember(x,y)}"
ADD 1
I can create another function, say, ismember2cell
that would apply ismember
and turn the outputs into arrays of cells:
function [a, b] = ismember2cell(x,y)
[a,b] = ismember(x,y);
a = {a};
b = {b};
end
, , , .