Error using feval Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
Afficher commentaires plus anciens
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 commentaire
William Gibson
le 4 Fév 2023
Réponse acceptée
Plus de réponses (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
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



