How do I perform differentiation on data samples?

13 Ansichten (letzte 30 Tage)
How do I perform differentiation on data samples using MATLAB?

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 2009
You can use the DIFF function to perform the differentiation.
PLEASE NOTE: DIFF is an overloaded function that behaves differently with different types of input.
You can use the DIFF function with MATLAB to obtain the difference. For example: If your data sample X is:
X= [X1 X2 X3 X4 X5 X6.... Xn]
then
diff(X)
will result in
[(X2-X1) (X3-X2) (X4-X3) .... (Xn-Xn-1)].
More information on DIFF can be found by typing the following at the MATLAB command prompt:
help diff
However, if you need to find the differentiation of the type d/dx, then you will need the DIFF function with the Symbolic Math Toolbox. The DIFF function in the Symbolic Math Toolbox differentiates a symbolic expression S with respect to its free variable. More information on this DIFF can be found by typing the following at the MATLAB command prompt:
help sym/diff
.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by