I am trying to find a way to store instructions on executing a line of code in a variable, so that when a user loads in that variable, they can execute the line of code contained within the variable. A simple example of something I'd like to run is:
So the user's code would look something like:
localVariable = 'foo';
loadedVar = load('file.mat','Var');
a = loadedVar
The desired output then when calling 'a' is:
Any ideas on how to accomplish this?