Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % --Network connectivity--
- clear all;
- N = 25;
- Dmax = 15;
- %part1
- node_x = 100*rand(N,1);
- node_y = 100*rand(N,1);
- plot(node_x, node_y, 'ro');
- hold on;
- %part2
- %matrix = euclidean(node_x, node_y);
- matrix2 = euclidean2(node_x, node_y);
- %part3
- [row, col] = find((matrix2<Dmax) & (matrix2~=0));
- Mx = [node_x(row);node_x(col)];
- My = [node_y(row);node_y(col)];
- line(Mx,My);
- hold off;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement