Newton-Raphson Method using a WHILE Loop. Help?
Show older comments
t1 = (t0 - (y1/y2)); %Creates a t1 value
while abs(t1-t0) > 1e-6 %Runs a loop when the value is larger than our error
t0 = t1; %New t1 becomes t0
y1 = f(t0); %Defines our functions at new t1
y2 = f(t0);
t1 = (t0 - (y1/y2)); %New t-value, essentially t2 and loops back through.
end
disp(t1)
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!