Alternative to 'eval', 'evalc','feval' etc functions in the Cody solutions
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Walter Roberson
am 28 Mär. 2014
str2func() or inline()
2 Kommentare
Walter Roberson
am 28 Mär. 2014
matlabFunction(sym(f))
matlabFunction automatically vectorizes.
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!