| Line | |
|---|
| 1 | function F = isfield(tree,uid,parameter)
|
|---|
| 2 | % XMLTREE/ISFIELD Is parameter a field of tree{uid} ?
|
|---|
| 3 | % FORMAT F = isfield(tree,uid,parameter)
|
|---|
| 4 | %
|
|---|
| 5 | % tree - a tree
|
|---|
| 6 | % uid - uid of the element
|
|---|
| 7 | % parameter - a field of the root tree
|
|---|
| 8 | % F - 1 if present, 0 otherwise
|
|---|
| 9 | %__________________________________________________________________________
|
|---|
| 10 | %
|
|---|
| 11 | % Is parameter a field of tree{uid} ?
|
|---|
| 12 | %__________________________________________________________________________
|
|---|
| 13 | % Copyright (C) 2002-2011 http://www.artefact.tk/
|
|---|
| 14 |
|
|---|
| 15 | % Guillaume Flandin
|
|---|
| 16 | % $Id: isfield.m 4460 2011-09-05 14:52:16Z guillaume $
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | %error(nargchk(3,3,nargin));
|
|---|
| 20 |
|
|---|
| 21 | F = zeros(1,length(uid));
|
|---|
| 22 | for i=1:length(uid)
|
|---|
| 23 | if isfield(tree.tree{uid(i)},parameter)
|
|---|
| 24 | F(i) = 1;
|
|---|
| 25 | end
|
|---|
| 26 | end
|
|---|
Note: See
TracBrowser
for help on using the repository browser.