How can i implement my method ?
Show older comments
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 Comments
Walter Roberson
on 9 Nov 2022
What do you know the classic method to do? What difficulties are you encountering in implementing whatever it is you are implementing ?
Rena Berman
on 15 Nov 2022
(Answers Dev) Restored edit
Bruno Luong
on 15 Nov 2022
EDIT: Format the restored question
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!