how to chekc if a node is present in a tree or not?

1 view (last 30 days)
clc;
clear all;
tr=tree('root');
[tr,NYT1]=tr.addnode(1,'0');
[tr,n1]=tr.addnode(1,'node1');
I am trying to check if node1 is present in 'tr' tree or not? I tried to use and 'isfield' they don't seem to work. Here is how I used them
isfield(tr.Node,'node(1).data')
it does not seem to recognize its presence, can anyone help? thanks.
  1 Comment
Geoff Hayes
Geoff Hayes on 5 Sep 2016
Samuel - is the tree class (?) something that you have written, is built-in to MATLAB, or from the File Exchange? Please provide a reference to this code.

Sign in to comment.

Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!