Not enough Input Arguments

3 次查看(过去 30 天)
Zia
Zia 2011-11-8
Hello,
I am trying to solve following code:
function dCb = buffer1(pH,Cb,Cw,Kws, Ca, Ka)
phspan = [2,13];
Cb0 = [0.02; 0];
Cw = 55.5;
pKw= 14;
Kw = 10^(-pKw);
Kws = Kw/Cw;
Ca= 0.01;
Ka= 2*10^-5;
dCb = 2.303*(10^(-pH)+(Ca*Ka*10^(-pH)/(10^(-pH)+Ka)^2)+(Cw*Kws*10^(-pH)/(10^(-pH)+Kws)^2)); %HIGHLIGHT HERE
ode = @(ph, Cb) buffer1(ph, Cw, Kws, Ca, Ka)
[ph. Cb] = ode45(ode, phspan, Cb0)
But i am getting error of NOT ENOUGH INPUT ARGUMENTS(at line 11-highlighted) I don't understand what is missing. Can anybody help me plz.
Thanks in advance:
Zia

回答(1 个)

Walter Roberson
Walter Roberson 2011-11-8
Your function handle "ode" accepts two input arguments, ignores the second of them (Cb), and calls buffer1() with 5 arguments.
function buffer1 expects 6 input arguments, not 5; in particular it expects its second input argument to be Cb, which your "ode" function handle does not pass to it.

类别

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