Home > lattice > Paramgroup > setparamgroup.m

setparamgroup

PURPOSE ^

SETPARAMGROUP modifies a group of parameters

SYNOPSIS ^

function NEWLATTICE = setparamgroup(LATTICE,PARAMGROUP,PVALUE,varargin)

DESCRIPTION ^

SETPARAMGROUP modifies a group of parameters
 NEWLATTICE = setparamgroup(LATTICE,PARAMGROUP,PVALUE)
 
 See also: ATPARAMGROUP RESTORPARAMGROUP

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function NEWLATTICE = setparamgroup(LATTICE,PARAMGROUP,PVALUE,varargin)
0002 %SETPARAMGROUP modifies a group of parameters
0003 % NEWLATTICE = setparamgroup(LATTICE,PARAMGROUP,PVALUE)
0004 %
0005 % See also: ATPARAMGROUP RESTORPARAMGROUP
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

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005