MATLAB Answers

Difference between D(f)(x) and diff( f(x) , x )

10 views (last 30 days)
Hello, So, I'm using the symbolic notation and I have defined both x and f(x) as symbolic functions like this
syms x f(x)
After a couple of operations, I get (in my Command window) a formula that includes both D(f)(x) and diff(f(x),x).
I was wondering if there is any difference between both of them or if they both represent the derivative of f in respect towards x.
Thanks a bunch


Sign in to comment.

Accepted Answer

Muhammad Usman  Saleem
Muhammad Usman Saleem on 23 Jun 2016
let say you are working with two for loops one has index variable f and other is x
means everytimes these loops run you are calling value of vector(may matrix) with indices f,x
diff( f(x) , x )
means you are calling vector f element of index x and with x( suppose your for loop has index variable x) taking its just difference.


Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by