在matlab中调试此代码

时间:2013-12-21 10:28:39

标签: matlab debugging graph-theory

 W = [.41 .99 .51 .32 ];
 DG = sparse([4 4 2 2 ],[1 3 1 3],W); 
 view(biograph(DG,[],'ShowWeights','on'));

我收到一条错误消息,说明以下内容

Error using ==> biograph.biograph at 155
CM must be a sparse or full square matrix

Error in ==> Untitled2 at 4
view(biograph(DG,[],'ShowWeights','on'))

1 个答案:

答案 0 :(得分:0)

阅读错误消息,DG是一个4x3矩阵,而不是方阵。