필터 지우기
필터 지우기

Is the a matlab function that approximates the derivative of a function?

조회 수: 2 (최근 30일)
ana
ana 2013년 8월 9일
I am trying to find the equivalent function to 'derivative' function in Scilab, is there something similar in Matlab? I searched quite a lot,but no lack so far, any advice would be much appreciated!
Thank you!

답변 (1개)

David Sanchez
David Sanchez 2013년 8월 9일
From Matlab documentation:
Y = diff(X)
calculates differences between adjacent elements of X.
Examples:
The quantity diff(y)./diff(x) is an approximate derivative.
x = [1 2 3 4 5];
y = diff(x)
y =
1 1 1 1
z = diff(x,2)
z =
0 0 0
Given,
A = rand(1,3,2,4);
diff(A) is the first-order difference along dimension 2.
diff(A,3,4) is the third-order difference along dimension 4.
  댓글 수: 3
Jan
Jan 2013년 8월 9일
편집: Jan 2013년 8월 9일
@ana: What is "LL"?
@David: gradient uses a 2nd order method and is therefore more accurate than diff.
dpb
dpb 2013년 8월 9일
I'm assuming OP may be looking for symbolic derivative for his function rather than numeric approximation, maybe????

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by