How to Normalize the gradient matrices

5 vues (au cours des 30 derniers jours)
bilal javed
bilal javed le 23 Déc 2018
I have a matrix F and initial[x1 y1] and final position[x2 y2]. I have to update the position [x y] using gradient of matrix F to get the desired position. My approach is like this:
[grad_x grad_y] = gradient(F);
[x_new y_new] = [x1 y1]+(step_size)*[grad_x(y1,x1), grad_y(y1,x1)];
I am taking step size 1. but when I tries to normalize the gradient matrices [grad_x grad_y] using formula norm_grad_x = grad_x/norm(grad_x), the values becomes very small and it is hard to update the position on every iteration. [x_new y_new] = [x1 y1]+(step_size)*[norm_grad_x(y1,x1), norm_grad_y(y1,x1)];
Can someone please guide me where I am having a mistake?

Réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by