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

조회 수: 5 (최근 30일)
Samuel Chandu
Samuel Chandu 2016년 9월 3일
댓글: Geoff Hayes 2016년 9월 5일
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