Error using secant method.

조회 수: 11 (최근 30일)
Natalie Spalding
Natalie Spalding 2021년 2월 22일
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개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by