Error using feval Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
Mostrar comentarios más antiguos
f(t)=[-cos(t), -sin(t), 2*cos(t)^3 - 7*cos(t)*sin(t)^2]
feval(f(t),3.14)
I'd like to evaluate the vector value function above at 3.14, but I get the error message in the subject line. How do I fix this?
1 comentario
William Gibson
el 4 de Feb. de 2023
Respuesta aceptada
Más respuestas (1)
syms t
f(t)=[-cos(t), -sin(t), 2*cos(t)^3 - 7*cos(t)*sin(t)^2]
Then
output = feval(f,3.14) %must "use" the output
or
f(3.14) %do not need to "use" the output
or
subs(f(t), t, 3.14) %do not need to "use" the output
Categorías
Más información sobre Linear Algebra 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!



