about gradient and diff
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
The help of my matlab says: (in article "gradient -Gradient vector of scalar function")
-If x is a scalar, gradient(f,x) = diff(f, x).
This is wrong, right?
diff(f,2) should = diff( diff(f) ) % means 2nd order diff
while gradient (f, 2) means the grid increment is 2. which means, for a curve f-t, or f(t), t is a linear space and dt = t(2)-t(1) = 2
Let me know everybody~ Thanks~
5 commentaires
Réponse acceptée
Walter Roberson
le 15 Juin 2013
Symbolic gradient, http://www.mathworks.com/help/symbolic/gradient.html, is the gradient vector of a scalar function, but numeric gradient, http://www.mathworks.com/help/matlab/ref/gradient.html is just "Numerical gradient". It is numerical gradient for which the "2" would mean a point spacing of 2, and it is the symbolic gradient for which the "2" would mean double differentiation.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!