Other alternative than syms for differentiation and integration?

2 次查看(过去 30 天)
Hello Everyone,
I'm trying to use differentiation in Matlab using this code
syms X;
fun = x^3+2*x+10;
diff (fun,x);
But I got this error
"Undefined function 'syms' for input arguments of type 'char'.
Error in Diff_Integ (line 1)
syms X;"
Is there any alternative ways to use differentiation without using syms?

回答(2 个)

Star Strider
Star Strider 2019-11-15
MATLAB is case-sensitive, so X ~= x.
Try this:
syms x;
fun = x^3+2*x+10;
dfundx = diff (fun,x);
producing:
dfundx =
3*x^2 + 2
  12 个评论

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2019-11-15
https://www.mathworks.com/help/matlab/ref/polyder.html for the special case of polynomials.

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by