This program calculates the roots of a system of non-linear equations in 2 variables. This a script file and you only have to write in the command windows ">>newton2v2", and the program ask for the functions and other elements that are necessary. What I mean "quotes" is single quotes,like this: ' .
I will be grateful for any comment.
I also have this program for 3, 4 ,5 variables and can be extended to any number of variables
When i am running your code for following equations,roots are not correct .Kindly help me.
f1(x,y) = '(((1+2*x^2)/(1-x^2))+(4*(1-2*y^2)*sqrt(1-x^2)*(2+x^2))/((1-x^2)*(1-y^2)^0.5*(2+y^2)))'
The first function? (between quotes) f1(x,y) = x+y
The second function? (between quotes)f2(x,y) = 2*x+y
??? Error using ==> diff
Difference order N must be a positive integer scalar.
Error in ==> newton2v2 at 24
gradf1 = [diff(f1name,'x') diff(f1name,'y')] ;