Graph and digraph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Graph and digraph

Armani Willis
Hi maintainers, i am trying to implement a new kind of architecture, but graph and digraph are not implemented, please follow this code by aditya pathak on mathworks.

Its a code to create node manually

Beaconx=400;beacony=400;
%axis on;gcf;
hold on;hbeacon=plot(beaconx,beacony,'s');
set(hbeacon,'color','red','linewidth',19);
%clear
Nodes=100;%rand('state',6);
figure(1);clf;hold on;
l=400;r=50;
netxloc=rand(1,nodes)*l;netyloc=rand(1,nodes)*l;
for i=1:nodes;plot(netxloc(i),netyloc(i),'.');
text(netxloc(i),netyloc(i),num2str(i));
for j=1:nodes;
d=sqrt((netxloc(i)-netxloc(j))^2+(netyloc(i)-netyloc(j))^2);
if d<=r;matrix(i,j)=1;nbr(i,j)=1;
line([netxloc(i) netxloc(j)],[netyloc(i) netyloc(j)],'linestyle','-');
else matrix(i,j)=inf; end end end