How to manipulate the sample code to get it work in the command h=view(bio​graph(DG,[​],'ShowWei​ghts','on'​)) Biograph object with 6 nodes and 11 edges.

조회 수: 1 (최근 30일)
The sample code runs just fine showing an error "CM must be a sparse or full square matrix." but when i change the values with my data then the same error appears without executing the commands. this is the sample code:(pic1.png) while my code is:(pic.png).I just want to know that both are same set of data but while executing an error appears which asks the result to be sparse and my result is in the form of sparse but it does not works.

답변 (1개)

sara masoud
sara masoud 2017년 12월 8일
>>W = [.41 .99 .51 .32 .15 .45 .38 .32 .36 .29 .21]; DG = sparse([6 1 2 2 3 4 4 5 5 6 1],[2 6 3 5 4 1 6 3 4 3 5],W)
DG =
(4,1) 0.4500
(6,2) 0.4100
(2,3) 0.5100
(5,3) 0.3200
(6,3) 0.2900
(3,4) 0.1500
(5,4) 0.3600
(1,5) 0.2100
(2,5) 0.3200
(1,6) 0.9900
(4,6) 0.3800
h = view(biograph(DG,[],'ShowWeights','on')) Biograph object with 6 nodes and 11 edges.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by