How get the Adjacency matrix from complete graph
6 ビュー (過去 30 日間)
古いコメントを表示
Konstantinos koutsikakis
2020 年 10 月 20 日
コメント済み: Konstantinos koutsikakis
2020 年 10 月 20 日
Hi I need get the Adjacency matrix from this code
% Complete Graph
% N no Nudes
% E = edges
n = input('Give Number Nudes: ');
E = (n*(n-1)/2);
theta = linspace(0,2*pi,n+1).';
theta(end)=[]; % 0 = 2pi so...
r = n;
cor = [r*cos(theta) r*sin(theta)]; % x coordinates of points
axes('nextplot','add')
while size(cor,1) > 1
cor_pt = repmat(cor(1,:),size(cor,1)-1,1); % point being connected to others
cor(1,:) = [];
for i = 1:size(cor_pt,1)
line([cor_pt(i,1),cor(i,1)],[cor_pt(i,2),cor(i,2)],'marker','.','markersize',30)
end
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!