Neumerical Methods- Newton Raphson Method

by

 

This script takes the input function adn solve it with the help of newton-Raphson

Newton_Raphson.m
clc 
clear all 
syms x;
d=input('Enter the Function');
f=inline(d);
z=diff(f(x));
f1=inline(z);
x0=input('Enter the Initial value');
x=x0;
for u=0:inf
    y=x;
    x=y-[f(x)/f1(x)];
    if x==y
        break
    end
end
u

Contact us