Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.39 KB | None | 0 0
  1. % --Network connectivity--
  2. clear all;
  3. N = 25;
  4. Dmax = 15;
  5.  
  6. %part1
  7. node_x = 100*rand(N,1);
  8. node_y = 100*rand(N,1);
  9.  
  10. plot(node_x, node_y, 'ro');
  11. hold on;
  12.  
  13. %part2
  14. %matrix = euclidean(node_x, node_y);
  15. matrix2 = euclidean2(node_x, node_y);
  16.  
  17. %part3
  18. [row, col] = find((matrix2<Dmax) & (matrix2~=0));
  19. Mx = [node_x(row);node_x(col)];
  20. My = [node_y(row);node_y(col)];
  21. line(Mx,My);
  22. hold off;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement