The function returns the solution of three equations in three variables using the Newton-Raphson method. The inputs are symbolic functions, initial guesses and number of iterations.
Here's an example;
syms x y z
u=3*x-cos(y*z)-1.5; v=4*x-625*(y^2)+2*z-1; w=20*z+exp(-x*y)+9;
xo=1;yo=2;zo=3;n=20,
Newton_Raphson(u,v,w,xo,yo,zo,n)
Ibrahim Abouemira (2021). Newton-Raphson Method for a nonlinear System of 3 variables (https://www.mathworks.com/matlabcentral/fileexchange/71593-newton-raphson-method-for-a-nonlinear-system-of-3-variables), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
how do i manipulate this code to be used for 4 equations?
Good one. Simple. Using predefined Matlab functions.