Error using feval Function to evaluate must be represented as a string scalar, character vector, or function_handle object.
显示 更早的评论
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 个)
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
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



