I have read so many times that functions eval() and evalin() are not recommended. What is the reason?
I have a situation where i want to evaluate the value of a parameter whose name is stored in string.
I obtained parameter name as
CostName=get_param(cblk,'Name');
Now i want value of this parameter from workspace so i wrote
CostVal=eval(strcat(CostName,'.Value'));
Is there any alternative for above line instead of using eval();
Best Answer