How to assign a set of parameters to a macroeconomic model in Matlab? I am trying to assign a vector of values (v= [1/3 0.01 0.5]) to a vector of parameters (w = [alpha beta gamma]) in order to make Matlab save the entries of the value vector as the parameter values. So for instance the third entry of v should be assigned to the third value in w. Matlab should then save gamma = 0.5 in the workspace. I was not able to figure out how to do it. My solution always just overwrites the other vector but does not save the entries in the workspace. I hope, someone can help me out.
Here is my approach to assign a set of parameters to a macroeconcomic model:
function para=assign_parameters(v)

if length(v)==3
   para.alpha=v(1);
   para.beta=v(2);
   para.gamma=v(3);
else
   error('parameter input has not correct format of length 3!');
end

The advantage is that the parameter set can be changed on the fly. That is, one can assign to the same underlying macroeconomic model a different set of numerical parameters without observing any conflict among the analyzed models. This would allow a quick comparison of model outcomes and ensure a clear as well as consistent model environment.
For instance, the example from the post can be assigned by
pm=assign_parameters(v)

and if one wants to study a second model like
v2=[2/3 1/100 1/2]

one should assign this set of parameters to a different structure name like
pm2=assign_parameters(v2)

Then both sets remain separated and the first parameter set will not be overwritten by the second.