How to Normalize the gradient matrices

5 visualizaciones (últimos 30 días)
bilal javed
bilal javed el 23 de Dic. de 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?

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by