tags:

views:

47

answers:

0

Hi,

I was wondering if anybody knows of a function or a contribution in the Mathworks file exchange repository that allows me to group and ungroup variables in a similar way save and load does

Let me explain this better with an example:

/* The variables 'one_variable', 'another_variable' and 'yet_another_variable' already exist in the workspace and are (possibly) of different types*/

/* The function group_variables, that is called next, outputs a struct that holds the variables that are passed to it as input arguments*/

group = group_variables('one_variable', 'another_variable', 'yet_another_variable', etc..);

/* e.g. group is built as follows: group.one_variable, group.another_variable, etc..*/

/* Now, the function "ungroup_variables" returns the variables 'one_variable' 'another_variable' & 'yet another variable' in the workspace where the function is called:*/

ungroup_variables(group);

/* Now I can reference the variables 'one_variable', 'another_variable', 'yet another variable', etc.. as before.*/

related questions