Hi Thirusabaresaan P,
I understand that you want to minimize a function using Newton-Raphson method, but the code is generating an error while updating the gradient value.
By making the following changes to your code, it should run smoothly without encountering any errors:
- In the line "x0(i+1) = I(1)-S(1,:)*J," change 'x0' to 'X0':
Original:
Revised:
- In the line "T = table(Iterations,X_coordinate,Y_coordinate,Z_coordinate = Z0');" replace "Z_coordinate = Z0'" with "Z_coordinate":
Original:
T = table(Iterations,X_coordinate,Y_coordinate,Z_coordinate = Z0');
Revised:
T = table(Iterations,X_coordinate,Y_coordinate,Z_coordinate);
- In the third last line of code, change "Z(i)" to "Z0(i)":
Hope this answer helps.