how to use single quotes in eval
Show older comments
so, the initial command is: plot(xtmc,ftmc,'LineWidth',3) Now, If I use "eval" the command would be: eval(['plot(xtmc,ftmc,', ''LineWidth'', ',3') (which doesn't work) So, is there any way to fix this question?
Also, I found that many people didn't recommend using "eval", so, is there any alternative function I can use?
2 Comments
Walter Roberson
on 13 May 2018
What are you doing that eval seems like something you might want to do?
"I found that many people didn't recommend using "eval", so, is there any alternative function I can use?"
The problem is not that eval is faulty and therefore another function is better, the problem is what people do with it. So far you have not told us why you need to use eval or what you are trying to do, so there is not really any more specific advice that we can give you apart from "most likely your approach is very inefficient and using eval is not a good solution".
Answers (1)
KALYAN ACHARJYA
on 13 May 2018
0 votes
Alternatives to the eval Function
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!