Built-in function diff - methodology

Hi,
What methodology is used in "diff"? Does it take forward or central differences, and what is the step? How can I check the source code?
Thanks in advance!

More Answers (2)

Jan
Jan on 3 Apr 2012
You cannot check the code of DIFF, because it is a built-in function. As Jonathan has said already, reading the doc will reveal the internal method. It is the difference of subsequent elements.
Thank you for the fast responses, I guess I'll need something else for my evaluation then. Have a good day!

2 Comments

I guess you are looking for GRADIENT.
I'll check it out, yes. I was interested in the order of the error, as I'm getting slightly different numbers from those obtained by a closed form solution. (slightly = 0.002, which is a lot, in my opinion). However, thanks for the answer!

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!