making combinations from each leaf to parent node in Matlab
Ältere Kommentare anzeigen
Hello, I have to make all combinations from a tree, starting from parent node and ends at the last leaf nodes. The depth of all leaf nodes is same. I don't understand how can i get such a combination... starting from parent node ending to the leaf node.
Can anyone help please.
5 Kommentare
Guillaume
am 19 Jun. 2018
Please use Comment on this question instead of starting new answers.
How is your tree stored in matlab?
Sohaib Bin Altaf
am 20 Jun. 2018
Bearbeitet: Walter Roberson
am 20 Jun. 2018
Sohaib Bin Altaf
am 20 Jun. 2018
Bearbeitet: Sohaib Bin Altaf
am 20 Jun. 2018
Guillaume
am 20 Jun. 2018
Where does the tree class come form? As far as I know there's no such thing in any matlab toolbox.
Sohaib Bin Altaf
am 21 Jun. 2018
Antworten (1)
Steven Lord
am 21 Jun. 2018
0 Stimmen
Consider building your tree as a graph. You could create the adjacency matrix or the edge lists as shown on that page or you could start with an empty graph and use addedge to add edges (either one at a time, or from a parent to each of its children, or in some other grouping.)
As you add edges, you can plot the resulting graph to see how it is growing. The rmedge function may help if you accidentally add the wrong edge.
1 Kommentar
Sohaib Bin Altaf
am 22 Jun. 2018
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!