Error using secant method.
11 views (last 30 days)
Show older comments
Given:

Why is this question also not giving any output at all? I've tried basing it off others that do work, but can't see where I'm going wrong.
%% Problem 3c. Secant Method(Needs Work)
clear all
clc
R=15/2;
v=500;
h=8;
i=1;
hold=0;
while(1)
fh=(pi^R*h^2-pi/(3*h^3-v));
fhold=((pi^R*hold^2-pi)/(3*hold^3-v));
hnew=h-(fh*(h-hold))/(fh-hold)
err=abs((hnew-h)/hnew);
if err<(1*10^(-8)),break,end
hold=h
h=hnew;
i=1+1;
end
i
h
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!