how can i rewired by replacing 2 edges at random then the code will be ?

조회 수: 2 (최근 30일)
mks
mks 2023년 8월 14일
답변: Steven Lord 2023년 8월 14일
n = 10;
x=accumarray([2 3 n-1 n]',1);
B = toeplitz(x,x);
G=graph(B);
plot(G)

답변 (1개)

Steven Lord
Steven Lord 2023년 8월 14일
You've been asking a lot of questions about how to manipulate graph objects in MATLAB. If you haven't already I strongly recommend you read through each of the Topics listed on the main Graph and Network Algorithms documentation page. Once you've gone through this (particularly the Modify Nodes and Edges of Existing Graph topic) I think you'll find it much easier to work with your graph objects.

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by