I have a function with variable arguments, declared in the standard way:
[] = foo ( varargin )
and I would like to call it from another function, but specify the arguments programmatically. My best attempt is something like the following:
% bar isn't populated like this, but this is how it ends up
bar = { 'var1' 'var2' 'var3' };
foo( bar );
However, bar is put into a 1x1 cell array, and not interpreted as a 1x3 cell array as I intended. I can't change foo, so is there a workaround?