Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to implement a tree in matlab?

Tags:

tree

matlab

I want to write an implementation of a (not a binary) tree and and run some algorithms on it. The reason for using the matlab is that the rest of all programs are in matlab and it would be usful for some analysis and plotting. From an initial search in matlab i found that there aren't thing like pointers in matlab. So I'd like to know the best ( in terms on convinience) possible way to do this in matlab ? or any other ways ?

like image 617
Rajesh D Avatar asked May 11 '11 13:05

Rajesh D


People also ask

How do you make a tree in Matlab?

t = uitree( parent ) creates a standard tree in the specified parent container. The parent can be a Figure created by using the uifigure function, or one of its child containers. t = uitree( parent , style ) creates a tree of the specified style in the specified parent container.

What is the best use for a tree algorithm?

Tree based algorithms are considered to be one of the best and mostly used supervised learning methods. Tree based algorithms empower predictive models with high accuracy, stability and ease of interpretation. Unlike linear models, they map non-linear relationships quite well.

How is binary tree usually implemented?

Binary trees can be implemented using pointers. A tree is represented by a pointer to the top-most node in the tree. If the tree is empty, then the value of the root is NULL.


1 Answers

You can do this with MATLAB objects but you must make sure you use handle objects and not value objects because your nodes will contain cross-references to other nodes (i.e. parent, next sibling, first child).

like image 73
David Heffernan Avatar answered Oct 13 '22 22:10

David Heffernan