Saturday, June 25, 2011

Generation of ON-OFF traffic [Matlab]


clc;
clear all;
x=1:10;
t=1:100;
on=input('Enter the Average ON Time: ');
%Users Vs Average ON Time
ton=zeros(10,100);
for i=1:10
ton(i,:)=poissrnd((on*10),1,100);
end
a=ton';
b=mean(a);
c=b/1000;
figure(1);
bar(x,c,0.35);
xlabel('Users');
ylabel('Average ON Time');
%Timeslots Vs Number of Users
n=zeros(10,100);
for i=1:10
for j=1:100
if (ton(i,j)>=4.5)
n(i,j)=1;
end
end
end
d=sum(n);
figure(2);
bar(t,d);
xlabel('Time Slots');
ylabel('Number of Users');
%Time slots Vs Bandwidth
bw=64000*n;
for i=1:10
figure(3);
subplot(5,2,i);
bar(t,bw(i,:),0.2)
xlabel('Time Slots');
ylabel('BW Alloted');
end

4 comments:

Unknown said...

can anyone give an explanation to this coding and also for all the Matlab coding in ccn lab.....very difficult to learn without understanding.....soon.....
please..... having midsem on monday

ajaikaran said...
This comment has been removed by the author.
ajaikaran said...

ask Dr gunasundari in pec....ΨΨΨ

Unknown said...

@ajai: Good advice........Thanks a lot

Google : The top most search engine

Google : MAGIC BOX

nRelate - Posts and Homepage

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Which is the toughest subject ?