How do I convert an anonymous function to a symbolic function in MATLAB?

依然范特西╮ 提交于 2019-12-01 00:57:52

问题


Say I have a anonymous function f = @(x) x^2 and I want to convert this to a symbolic function. Is there a built in command for that?


回答1:


You could just pass it to SYM:

f = @(x) x^2;
g = sym(f)

But then most of the symbolic functions do that automatically when they receive a function handle (subs, int, etc...)



来源:https://stackoverflow.com/questions/11322295/how-do-i-convert-an-anonymous-function-to-a-symbolic-function-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!