MATLAB: How to convert a string which contains a variable name into a variable which can be called

stringstringsvariablevariables

I am creating a function which scans files for a certain function and determines which variables (all are already initialized) are used as parameters for the function. Currently, I am able to derive a cell array with strings for each individual variable. The program takes this:
x = DummyFunction(a, b, c);
And returns this:
{'a'} {'b'} {'c'}
I am trying to convert these strings, which contain pre-established variables, into variables which can be called. Any suggestions?
Thanks in advance, Ak

Best Answer

You do not need to do that.
Put all of the variables into a structure, using dynamic field names. Then when you need to recall them by name,
Variables_for_this_call = cellfun(@(name) StructureOfVariables.(name), ListOfNames, 'uniform', 0);
After which you can
DummyFunction(Variables_for_this_call{:})