to understand the phytree object in matlab -


i asked similar question here: what phytree object in matlab?. did try it.

clear; d=[4,2,5,4,5,5]; z=seqneighjoin(d); view(z) get(z, 'pointers') 

this output:

ans =

     1     2      3     5      4     6 

and phytree figure in following. understanding, matrix same tree field of phytree object. relation between matrix , figure?

you should interpret array in following way.

firstly, have 4 nodes 1, 2, 3 , 4. in graph attach, node 1 labelled leaf 1; node 2 labelled leaf 3; node 3 labelled leaf 2; , node 4 labelled leaf 4.

then take each row of array in turn.

the first row indicates first join nodes 1 , 2 - call node 5, it's smallest number greater 4 nodes have. on graph, node connecting leaf 1 , leaf 3.

then second row indicates next join nodes 3 , 5 - call node 6, again it's smallest number after node 5. on graph, node connecting previous join leaf 2.

then third row indicates lastly join nodes 4 , 6 - don't need call it's final root node, node 7. on graph, node connecting previous join leaf 4.

does make more sense?


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -