0001 function NEWLATTICE = setparamgroup(LATTICE,PARAMGROUP,PVALUE,varargin)
0002
0003
0004
0005
0006
0007 NEWLATTICE=LATTICE;
0008
0009
0010 if nargin == 3
0011 for i=1:length(PARAMGROUP)
0012 NEWLATTICE{PARAMGROUP(i).ElemIndex}=...
0013 setfield(NEWLATTICE{PARAMGROUP(i).ElemIndex},...
0014 PARAMGROUP(i).FieldName,PARAMGROUP(i).FieldIndex,...
0015 feval(PARAMGROUP(i).Function,PVALUE,PARAMGROUP(i).Args{:}));
0016 end
0017 else
0018 for i=1:length(PARAMGROUP)
0019 NEWLATTICE{PARAMGROUP(i).ElemIndex}=...
0020 setfield(NEWLATTICE{PARAMGROUP(i).ElemIndex},...
0021 PARAMGROUP(i).FieldName,PARAMGROUP(i).FieldIndex,...
0022 feval(PARAMGROUP(i).Function,PVALUE,varargin{:}));
0023 end
0024 end