-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathset.m
26 lines (22 loc) · 966 Bytes
/
set.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function tree = set(tree,uid, parameter, value)
% XMLTREE/SET Method (set object properties)
% FORMAT tree = set(tree,uid,parameter,value)
%
% tree - XMLTree object
% uid - array (or cell) of uid's
% parameter - property name
% value - property value
%_______________________________________________________________________
%
% Set object properties given its uid and pairs parameter/value
% The tree parameter must be in input AND in output
%_______________________________________________________________________
% Copyright (C) 2002-2008 http://www.artefact.tk/
% Guillaume Flandin <guillaume@artefact.tk>
% $Id: set.m 1460 2008-04-21 17:43:18Z guillaume $
error(nargchk(4,4,nargin));
if iscell(uid), uid = [uid{:}]; else uid = uid(:); end
for i=1:length(uid)
tree.tree{uid(i)} = builtin('subsasgn', tree.tree{uid(i)}, struct('type','.','subs',parameter), value);
%tree.tree{uid(i)} = setfield(tree.tree{uid(i)},parameter,value);
end