Why can't a variable holding an equation be used to make a function handle?

1 次查看(过去 30 天)
%% Test
syms x
eqn(x) = x^2
func = @(x) eqn
func(2)

采纳的回答

madhan ravi
madhan ravi 2020-2-20
I would simply use matlabFunction() as sir Walter says but maybe you have the follwing in mind:
func = @(x) eqn(x)

更多回答(1 个)

Walter Roberson
Walter Roberson 2020-2-20
Use matlabFunction()

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by