MATLAB: Can’t a variable holding an equation be used to make a function handle functionhandlesMATLAB %% Testsyms xeqn(x) = x^2func = @(x) eqnfunc(2) Best Answer I would simply use matlabFunction() as sir Walter says but maybe you have the follwing in mind:func = @(x) eqn(x) Related SolutionsMATLAB: Is there a reason MuPad doesn’t find the obvious cancellation I'm guessing it's something to do with assumptions about squares and square roots, and maybe denominators. Wouldn't swear to it, though. If you want it to do what you'd probably do by hand, you can try this:Simplify(f * sqrt( 1 + df^2 ),IgnoreAnalyticConstraints)(Note the capital S) MATLAB: Create an anonymous function after Symbolic differentiation Almost there!gfun = matlabFunction(g)g(2) Related QuestionDefining a symbolic function using the “diff” commandSymbolic differentiation with respect to first derivativeSymbolic Math Toolbox Explicit integralIdentification of Flight Holding Pattern
Best Answer