Root Finding Newton Method
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am a beginner at coding working on this homework assignment to make a working Newton method root finder. When I do this on paper I can figure out what needs to happen. I am so lost to getting it into code. I think that I need to put in a new variable to find the roots of a function but I'm really uncertain how to do that. Can anyone help me out?
function [y] = Newton_3397(chuckie,x)
syms x
%chuckie(x)=x.^2-7
y=x-(chuckie(x)/diff(chuckie(x)));
y=vpa(subs(y,x,1));
ans=y-(chuckie(x)/diff(chuckie(x)))
end
0 Commenti
Risposte (1)
Walter Roberson
il 17 Ott 2020
function [y] = Newton_3397(chuckie,x)
syms x
You should not be ignoring the input x value. The user is supposed to pass you an initial value, the point to start at.
function [y] = Newton_3397(chuckie,x0)
and
x0=vpa(subs(y,x,x0));
and you just repeat that same assignment several times until you are satisfied that the error is low enough.
0 Commenti
Vedere anche
Categorie
Scopri di più su Systems of Nonlinear Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!