File Exchange

## NEWTON RAPHSON FUNCTION

version 1.0.0.0 (2.02 KB) by Sandeep Solanki

### Sandeep Solanki (view profile)

Newton Raphson method to find root of equation.

Updated 11 Jun 2012

% Function :
% X = newtonraphson(fun_str,Start_Point)
% Finds the root of an equation by NEWTON-RAPHSON METHOD.
%
% x(n+1) = x(n) - (F(x(n))/diff(F(x(n)));
%
% INPUTS :
% Eqn_Str : The equation whose root has to be find.
% Eqn_Str Should be an string format.
% Example :
% if F(x) = x^4 - x - 10
% the Eqn_Str = 'x^4 - x - 10';
%
% Start_Point : Initial value of root X ==> x0
%
% Max_Iter : Maximum number of iterations
%
% OUTPUT :
% X : Estimeted root of Equation.
%--------------------------------------------------------------------------
% By :-
% SANDEEP SOLANKI
% rtm_sandeep@rediffmail.com
%--------------------------------------------------------------------------

### Cite As

Sandeep Solanki (2020). NEWTON RAPHSON FUNCTION (https://www.mathworks.com/matlabcentral/fileexchange/37098-newton-raphson-function), MATLAB Central File Exchange. Retrieved .

Naceur Khraief

### Naceur Khraief (view profile)

Dear,

Demo does not working. I've got this message:

Error using inline (line 50)
Input must be a string.

Error in newtonraphson (line 52)
fxd = inline(diff(Eqn_Str));

Error in demo (line 6)
x = newtonraphson(fun,start,iter);

Johanes

### Johanes (view profile)

not working. you can't inline double array!

Lampor

### Lampor (view profile)

I need to solve this problem using newton-raphson.

R= 1000 to 100000 (step 1000)

the equation need to be solve is:

4.04+3.94*log(R*x^0.5)-(1/x^0.5)=0

I need every single value of x for every value of R.

I wrote a code, but it only work when R=1000, if I change R=100000 (just trying by add 1 input of R, actually R that I need is like I said above), matlab keep being busy... don't know why...