You are on page 1of 1

function newton(fun,v0,tol)

%Ingreso de todos los valores

dfun=diff(fun);
f=feval(fun,v0);
df=feval(dfun,v0);
c=1;
while abs(f)>tol
a=v0-f/df;
f=feval(fun,a);
df=feval(fun,a);
v0=a;
c=c+1;
end
c
a

newton('((R.*T)./(v-b))-(as.*Alp)./
Alp=0.88416;
as=387.5757;
b=0.0211736;
R=8.31451;
T=500;
P=101.324;

You might also like