How do I perform differentiation on data samples?
조회 수: 14 (최근 30일)
이전 댓글 표시
How do I perform differentiation on data samples using MATLAB?
채택된 답변
MathWorks Support Team
2009년 6월 27일
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
.
댓글 수: 0
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!