How to Normalize the gradient matrices

3 Ansichten (letzte 30 Tage)
bilal javed
bilal javed am 23 Dez. 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?

Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices 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!

Translated by