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 日間)
Student
Student 2015 年 12 月 3 日
回答済み: sara masoud 2017 年 12 月 8 日
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 Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by