Capacity of a cell (traffic measurement)
조회 수: 4 (최근 30일)
이전 댓글 표시
PART A
if (length(N)~=1) | (fix(N) ~= N) | (N < 0)
error('N must be a scalar positive integer');
end
% TODO: test that elements of A are real and positive here?
esum = zeros(size(A));
for ii=0:N
esum = esum + A .^ ii ./ factorial(ii);
end
B = A .^ N ./ (factorial(N) .* esum);
PART B
% ex1.m example for erlangb function
close all
clear all
lambda=0:0.0001:0.0065; % mean arrival rate (calls per second)
d=200; % mean duration (seconds per call)
a = lambda.*d; % traffic intensity in Erlangs
n = 1;
b = erlangb(n, a); % n channels/servers
ii=find(b<0.1);
plot(a(ii), b(ii), 'b')
hold on
n = 2;
b = erlangb(n, a); % n channels/servers
ii=find(b<0.1);
plot(a(ii), b(ii), 'g')
n = 3;
b = erlangb(n, a); % n channels/servers
plot(a, b, 'r')
n = 4;
b = erlangb(n, a); % n channels/servers
plot(a, b, 'k')
legend('1', '2', '3', '4 channels', 0)
xlabel('Traffic Intensity (Erlangs)');
ylabel('Blocking Probability');
title('Erlang B formula');
plot(a, 0.02, ':k') % 2% line
I inputed the above code into matlab,at first only part B it then shows me "error in erlangb (line 7) b=erlangb (n, a)". And again on adding PART A it pops up "no input argument,requires more input argument to run". please help
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!