Is there a way to assign values to variable names which are both supplied by the user?
I thought of something along these lines:
function varargout=my_fun(varargin)
for i=1:2:nargin
eval('varargin{i}=varargin{i+1}')
end
>> my_fun('a',1,'b',2)
>> a
1
>> b
2
but it doesn't work.