Thursday, May 5, 2011

Accessing variables as string (matlab)

Easy access to the variables via evaluation command


variables = {'a', 'b','c'}
a = 22;
% operations
eval(variables{1})+2
% works

No comments: