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