Why am I getting error "Array indices must be positive" and error in syms, when using eval function
Mostrar comentarios más antiguos
Why am I getting errors when using the eval function?
syms x
f(x) = 3.5*x*(1-x)
f2 = f(f(x))
eqn2 = f2 == x;
sol= (solve(eqn2,x))
eval(f2(sol(2)))
I have used the same steps to evaluate f with no errors.
Any pointers would be really appreciated.
1 comentario
"Why am I getting errors when using the eval function? "
Because EVAL is completely the wrong tool for the job.
Note that EVAL is not listed anywhere in the Symbolic Toolbox documentation: https://www.mathworks.com/help/symbolic/referencelist.html?type=function
The correct use of EVAL is with MATLAB code, not with objects from the Symbolic Math Toolbox:
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Code Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




