I have to run following with eval function in a single line.
a = 1:20;
b = '[nan a(2:end)]';
c = eval(b);
My proposal is (which is wrong);
>> b = 'a = 1:20; [nan a(2:end)]';
>> c = eval(b)
Error: The expression to the left of the equals sign is not a
valid target for an assignment.
There are some suggestions not to use eval. I have to use. Any help apreciated!