Alternative to 'eval', 'evalc','feval' etc functions in the Cody solutions
5 次查看(过去 30 天)
显示 更早的评论
Why cody does not allow 'eval', 'evalc','feval' etc functions in the solutions? What is alternative to these functions?
e.g. I need to use:
if f='3*x'
x=0:10;
y=eval(vectorise(f))
so that values of y can be calculated as 3.*x
bt cody does not let us to use functions like eval
What is the alternative?
0 个评论
回答(1 个)
Walter Roberson
2014-3-28
str2func() or inline()
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!