Error using secant method.

11 visualizaciones (últimos 30 días)
Natalie Spalding
Natalie Spalding el 22 de Feb. de 2021
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

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by