Benjamin Lindner wrote:
Also, I would like to wrap this transformation into a function. I
tried it like
this (in octave compiled from the current tip):
function varargout = struct2options (structure)
varargout = {fieldnames(structure)'{:}; struct2cell(structure)'{:}};
nargout
endfunction
this should read
function c = struct2opt(s)
c = reshape(cat(2, fieldnames(s), struct2cell(s)).',1,[]);
endfunction
then
plot(1:5, 5:-1:1, struct2opt(style){:})
should work
Yes, that is a way how to do it. However, I would like to eliminate the
{:} part :-)
Also, the more general question is interesting to me: can I somehow
control how many arguments are passed in this nested function call:
function1(function2())
if function 2 has varargout and function 1 has varargin