CS计算机代考程序代写 root1=SecantMethod(4)

root1=SecantMethod(4)
root2=SecantMethod(2)

function cr=SecantMethod(ci)
cim1=ci-1
fi=(50./ci)*(1-exp(-9*ci/5))-10;
while abs(fi)>1.0e-6
fi=(50./ci)*(1-exp(-9*ci/5))-10;
fim1=(50./cim1)*(1-exp(-9*cim1/5))-10;
cip1=ci-(ci-cim1)*fi/(fi-fim1)
cim1=ci;
ci=cip1;
end
cr=cip1;
end