How can i show Packet drop or delay in this below given sensor network, edit it in matlab by showing packet drop/delay? file is attached,thanks

3 views (last 30 days)
plz include some code of lines that will show packet drop, throughput or delay in this network,the code is given below in matlab.thanks
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)

Categories

Find more on WSNs in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!