MATLAB Answers

Other alternative than syms for differentiation and integration?

3 views (last 30 days)
Muhammad Fakhruddin Abd Rahim
Commented: Star Strider on 18 Nov 2019
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?

  0 Comments

Sign in to comment.

Answers (2)

Star Strider
Star Strider on 15 Nov 2019
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 Comments

Show 9 older comments
Star Strider
Star Strider on 15 Nov 2019
@Muhammad Fakhruddin Abd Rahim — I was not ignoring you. I was sleeping.
@Walter — Thank you for following up with your Comments.
@Stephen — Thank you for following up with your Comments.

Sign in to comment.


Sign in to answer this question.