Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I write a code when few node are connected five edges and some nodes are connected four,three and 2 edges .please help me on this .

1 回表示 (過去 30 日間)
mks
mks 2023 年 8 月 13 日
閉鎖済み: Steven Lord 2023 年 8 月 13 日
clc;
clear all;
n = 10;
C= zeros(n, n);
C(1,n)=1;
C(1,n-1)=1;
C(2,n)=1;
A = zeros(n, n);
for i = 1:n
for j = 1:n
if j==i+1 || j == i + 2
A(i,j) = 1;
else
A(i, j) = 0;
end
end
end
B1=A+C
B=B1+B1';
G=graph(B);
plot(G)

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by