How can I find the maximum gradient around a data point?
Afficher commentaires plus anciens
I want to find the x/y indices on a surface where the gradient reaches its maximum around a point P.
For example, let's take the following surface Z:
[X,Y] = meshgrid(-2:.2:2);
Z = X.*exp(-X.^2 - Y.^2);
Z(Z<0) = 0;
[DX,DY] = gradient(Z,.2,.2);
g = sqrt(DX.^2+DY.^2);
figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off
Let's say the position of the peak, Z(21,28), is known. Now, I'm looking for the x/y indices, where g (gradient) reaches its highest values around this peak, which would be an oval-like line. How can it be done?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!