MATLAB: How to execute string variable

evalexecutestrings

can i do this in matlab? %first i want to make a variable named = xxx, and xxx contains MATLAB commands just like this:
xxx = strvcat('x0=5','a=2','c=x0+a')
%but when I use eval, it doesn't work eval(xxx)
Anyone can help me?

Best Answer

xxx = strcat('x0=5;','a=2;','c=x0+a;');
eval(xxx);
Related Question