Error using feval Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
Show older comments
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 Comment
William Gibson
on 4 Feb 2023
Accepted Answer
More Answers (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
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


