i am using minspantree function of matlab.i need to convert tree output of this function to an array.output tree looks like as (1.2) 1....(3,4) 1....(5,8) 1...first digit in parentheis indicates destination node and second digit is source
조회 수: 3 (최근 30일)
이전 댓글 표시
CMatrix=adj_mat;
BioGobj = biograph(CMatrix);
% view(BGobj);
[Tree, pred] = minspantree(BioGobj);
댓글 수: 0
채택된 답변
Ingrid Tigges
2013년 6월 10일
Did I understand you correctly that you want to have a "normal" matrix rather than a sparse matrix?
If this is the case you can use the MATLAB command FULL:
cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
bg1 = biograph(cm)
[Tree, pred] = minspantree(bg1)
Tree_full = full(Tree)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cartesian Coordinate System Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!