Changeset 925 for trunk/src/@xmltree/length.m
- Timestamp:
- Feb 17, 2016, 12:52:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/@xmltree/length.m
r723 r925 7 7 % tree (deleted nodes aren't populated) 8 8 % l - length of the XML tree (number of nodes) 9 %_______________________________________________________________________ 9 %__________________________________________________________________________ 10 10 % 11 11 % Return the number of nodes of an XMLTree object. 12 %_______________________________________________________________________ 13 % @(#)length.m Guillaume Flandin 02/03/2712 %__________________________________________________________________________ 13 % Copyright (C) 2002-2011 http://www.artefact.tk/ 14 14 15 error(nargchk(1,2,nargin)); 15 % Guillaume Flandin 16 % $Id: length.m 4460 2011-09-05 14:52:16Z guillaume $ 17 18 19 %error(nargchk(1,2,nargin)); 16 20 17 21 % Return the full number of nodes once allocated … … 20 24 % Substract the number of deleted nodes to the previous length 21 25 if nargin == 2 22 23 24 25 26 27 28 29 30 31 32 26 if strcmp(r,'real') 27 ll = 0; 28 for i=1:l 29 if ~strcmp(tree.tree{i}.type,'deleted') 30 ll = ll + 1; 31 end 32 end 33 l = ll; 34 else 35 error('[XMLTree] Bad input argument.'); 36 end 33 37 end
Note: See TracChangeset
for help on using the changeset viewer.