You are on page 1of 1

function [xnew] = newton_raphson_mtd(x,iterations)

%Employs the Newton Raphson method to determine a root


%of the equation. The user must input the initial guess (x) and the number
%of iterations they wish to use (iterations). The equation used in this
%problem has three real roots, so your initial guess will play a
%significant role of which real root this function will output.
for i=1:iterations;
x(i+1) = x(i) - ((2*x(i)^3 - 11.7*x(i)^2 + 17.7*x(i) - 5)/(6*x(i)^2 -
23.4*x(i) + 17.7));
end;
k=iterations + 1;
HighestRoot=x(k)
end

You might also like