How can i implement my method ?
古いコメントを表示
I know the classic newton method but i can not implement the fourier form please help me.
%Newton-Raphson method
clear;
clc
%first plot the function
plot(f) x=0:0.05:4;
f=@(x)(x^3)+(x^2)-(x)-1;
plot(x,f(x));
grid
fd=@(x)3*x^2+2*x-1;
x1=input ('x1=');
tol=0.000001;
i = 0;
while abs(f(x1)) > tol
f1=f(x1);
f1d=fd(x1);
x2=x1-(f1/f1d);
f2=f(x2);
x1=x2;
i = i + 1;
fprintf('%9.6f %13.6f \n',x2,f2)
end
3 件のコメント
Walter Roberson
2022 年 11 月 9 日
What do you know the classic method to do? What difficulties are you encountering in implementing whatever it is you are implementing ?
Rena Berman
2022 年 11 月 15 日
(Answers Dev) Restored edit
Bruno Luong
2022 年 11 月 15 日
EDIT: Format the restored question
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
