Info

This question is closed. Reopen it to edit or answer.

how can i include a few lines of code in this program in order to show packet drop or delay or througput, thanks

1 view (last 30 days)
Help me in showing packet drop/delay/throughput in this below matlab program.
clear All
Close All
clc
rand('state',0);
xx=rand(1,5)*5;
yy=rand(1,5)*5;
R=3;
nodearray=[xx;yy]';
for i=1:5
hold on
% x=nodearray(n,1);
%y=nodearray(n,2);
plot(xx,yy,'*');
text(xx(i),yy(i),num2str(i));
hold on
title('Speed');
for j=1:5
d=sqrt((xx(i)-xx(j))^2+(yy(i)-yy(j))^2);
if d<=R
line([xx(i) xx(j)],[yy(i) yy(j)])
end
end
axis([0 6 0 6])
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!