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

后端 未结 1 1139
广开言路
广开言路 2021-01-12 03:27

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条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 03:35

    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...)

    0 讨论(0)
提交回复
热议问题