How can i implement my method ?
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 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
le 15 Nov 2022
(Answers Dev) Restored edit
Bruno Luong
le 15 Nov 2022
EDIT: Format the restored question
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
