MATLAB Answers

Why does it says makeFhandle,Not enough input arguments. at DF=(z)What can I do?

1 view (last 30 days)
Thanuja Bandara
Thanuja Bandara on 14 Apr 2020
Edited: Walter Roberson on 15 Apr 2020
R=518;
T=223;
p=65000000;
Tc=191;
Pc=4580000;
a=(0.427)*((R^2)*(Tc^2.5))/Pc;
b=(0.0866)*((R*Tc)/Pc);
z=input('Input initial guess- ');
sym v;
fun= @(v) p-(R*T./(v-b)) +( a./(v.*(v+b)*sqrt(T)));
A=matlabFunction(diff(fun,v));
F=fun(z);
DF=A(z);
n=1;
Ea=100;
while abs((Ea))>=10^(-5)
disp(F);
disp(DF)
zi=z-(F/DF);
Ea=((zi-z).*100)/zi;
z=zi;
n=n+1;
end
disp(zi);
disp(Ea);
disp(n);

  4 Comments

Show 1 older comment
Walter Roberson
Walter Roberson on 14 Apr 2020
I did not have any trouble after I made that change
which MATLAB version are you using?
Thanuja Bandara
Thanuja Bandara on 15 Apr 2020
I am using matlab 2013. I think that was the problem.
A=matlabFunction(diff(fun(v)))
After changing it like that I got the answer. Thank you very much for your help.

Sign in to comment.

Answers (0)

Sign in to answer this question.


Translated by