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

1 次查看(过去 30 天)
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 个评论
Geoff Hayes
Geoff Hayes 2016-9-5
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by