Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

9/22/17 8:01 PM E:\studies\matlab\switching.

m 1 of 2

N = input('Enter the total number of users: ')


Eu = input ('Enter the Erlang User: ');
Pb = input ('Enter the blocking probability as a number: ');

%Finding Divisors of 'N'%


L = 1:N;
y = L(rem (N,L)==0);
j = length (y);

%Possible "n" and "m"%


n = N./(y)
m = N./(n)
t = length (n);
s = 1;
u = t-2;

for j = 1:t
k = 1;

while k < N

q = (n(j)*Eu)/k ;

p = ((1-(1-q))^2)^k ;

if p < Pb
P(j) = p ;
K(j) = k ;
C(j) = (2*K(j)*N) + (K(j)*m(j)*m(j));

break
end
k = k+1;
end

end
%Data Segregation and Plotting%
for l = 1:u

g(l)= n(l+1)
h(l)= C(l+1)
plot (g,h,'-o')
end

You might also like