Changeset 925 for trunk/src/@xmltree/get.m
- Timestamp:
- Feb 17, 2016, 12:52:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/@xmltree/get.m
r723 r925 7 7 % parameter - property name 8 8 % value - property value 9 %_______________________________________________________________________ 9 %__________________________________________________________________________ 10 10 % 11 11 % Get object properties of a tree given their UIDs. 12 %_______________________________________________________________________ 13 % @(#)get.m Guillaume Flandin 02/03/2712 %__________________________________________________________________________ 13 % Copyright (C) 2002-2011 http://www.artefact.tk/ 14 14 15 error(nargchk(2,3,nargin)); 15 % Guillaume Flandin 16 % $Id: get.m 4460 2011-09-05 14:52:16Z guillaume $ 17 18 19 %error(nargchk(2,3,nargin)); 16 20 17 21 value = cell(size(uid)); 18 22 uid = uid(:); 19 23 if nargin==2 20 21 if uid(i)<1| uid(i)>length(tree.tree)22 23 24 25 26 27 24 for i=1:length(uid) 25 if uid(i)<1 || uid(i)>length(tree.tree) 26 error('[XMLTree] Invalid UID.'); 27 end 28 % According to the type of the node, return only some parameters 29 % Need changes... 30 value{i} = tree.tree{uid(i)}; 31 end 28 32 else 29 30 try, 31 32 catch, 33 34 35 33 for i=1:length(uid) 34 try 35 value{i} = subsref(tree.tree{uid(i)}, struct('type','.','subs',parameter)); 36 catch 37 error(sprintf('[XMLTree] Parameter %s not found.',parameter)); 38 end 39 end 36 40 end 37 41 if length(value)==1 38 42 value = value{1}; 39 43 end
Note: See TracChangeset
for help on using the changeset viewer.