Urgent, need help to complete newton raphson method script.

Trying to create a script to find the roots of a function using the newton raphosn method however i am stuck on the script.
function[out]=Newtonmethod(x,M,d,e,f,fd)
v=f(x);
if abs(v)<e
return
end
for k=1:M
x1=x-v/fd(x);
v=f(x1);
fprintf('X1= %f %d %c \n',x1)
fprintf('V= %f %d \n',v)
fprintf('k= %d \n',k)
if abs(x1-x)<d || abs(v)<e
return
end
end
x=x1;
end
%Newtonmethod(5,100,0.05,2)

1 件のコメント

Jan
Jan 2017 年 2 月 27 日
編集済み: Jan 2017 年 2 月 27 日
If you are really in a hurry, provide a description of the problem you have. It is hard to answer to "I am stuck on the script". How can we help you?

サインインしてコメントする。

回答 (0 件)

質問済み:

2017 年 2 月 27 日

編集済み:

Jan
2017 年 2 月 27 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by