Hi. How can i rectify my error i.e., not enough arguments

조회 수: 1 (최근 30일)
sivasingh mahendranagar
sivasingh mahendranagar 2014년 10월 31일
댓글: Roger Stafford 2014년 10월 31일
HI, While executing this program
function erb = erlang_b(A,C)
% A= offered traffic in Erlangs.
% C= number of trunked channels.
num = A^C;
sum = 0
for k=0;C
kfact = product(1:k);
term = (A^k)/kfact;
sum = sum+term;
end
Cfact = prod(1:C);
den = Cfact*sum;
erb = num/den;
Iam getting an Error i.e.,using erlang (line 4) Not enough input arguments. How can i resolve this
  댓글 수: 1
Roger Stafford
Roger Stafford 2014년 10월 31일
I notice an error in the script of your "erlang" function. The line
for k=0;C
should read:
for k=0:C

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt Tearle
Matt Tearle 2014년 10월 31일
How are you calling this function? It has to be called with two inputs:
foo = erlang_b(pi,42)
The error you're getting is the one people get when they make the classic mistake of trying to run the function as a script (such as hitting the Run button).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by