Is the a matlab function that approximates the derivative of a function?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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!
0 Kommentare
Antworten (1)
David Sanchez
am 9 Aug. 2013
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 Kommentare
dpb
am 9 Aug. 2013
I'm assuming OP may be looking for symbolic derivative for his function rather than numeric approximation, maybe????
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!