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!
