argselectAssign

PURPOSE ^

argselectAssign : Assign variables in calling workspace

SYNOPSIS ^

function argselectAssign(variable_value_pairs)

DESCRIPTION ^

 argselectAssign : Assign variables in calling workspace

  function argselectAssign(variable_value_pairs)
  
  Inputs : 
  variable_value_pairs is a cell list of form
  'variable1',value1,'variable2',value2,...
  This function assigns variable1=value1 ... etc in the *callers* workspace

  This is used at beginning of function to simulate keyword argument
  passing. Typical usage is

  argselectAssign(control_params);
  argselectCheck(control_params,varargin);
  argselectAssign(varargin);

  where control_params is a cell list of variable,value pairs containing
  the default parameter values.
 
 See also argselectCheck

 This file is part of BPDQ Toolbox (Basis Pursuit DeQuantizer)
 Copyright (C) 2009, the BPDQ Team (see the file AUTHORS distributed with
 this library) (See the notice at the end of the file.)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % argselectAssign : Assign variables in calling workspace
0002 %
0003 %  function argselectAssign(variable_value_pairs)
0004 %
0005 %  Inputs :
0006 %  variable_value_pairs is a cell list of form
0007 %  'variable1',value1,'variable2',value2,...
0008 %  This function assigns variable1=value1 ... etc in the *callers* workspace
0009 %
0010 %  This is used at beginning of function to simulate keyword argument
0011 %  passing. Typical usage is
0012 %
0013 %  argselectAssign(control_params);
0014 %  argselectCheck(control_params,varargin);
0015 %  argselectAssign(varargin);
0016 %
0017 %  where control_params is a cell list of variable,value pairs containing
0018 %  the default parameter values.
0019 %
0020 % See also argselectCheck
0021 %
0022 % This file is part of BPDQ Toolbox (Basis Pursuit DeQuantizer)
0023 % Copyright (C) 2009, the BPDQ Team (see the file AUTHORS distributed with
0024 % this library) (See the notice at the end of the file.)
0025 
0026 function argselectAssign(variable_value_pairs)
0027 for j =1:2:length(variable_value_pairs)
0028   pname=variable_value_pairs{j};
0029   pval=variable_value_pairs{j+1};
0030   assignin('caller',pname,pval);
0031 end
0032 
0033 % The BPDQ Toolbox is free software: you can redistribute it and/or modify
0034 % it under the terms of the GNU General Public License as published by
0035 % the Free Software Foundation, either version 3 of the License, or
0036 % (at your option) any later version.
0037 %
0038 % The BPDQ Toolbox is distributed in the hope that it will be useful,
0039 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0040 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0041 % GNU General Public License for more details.
0042 %
0043 % You should have received a copy of the GNU General Public License
0044 % along with The BPDQ Toolbox.  If not, see <http://www.gnu.org/licenses/>.

Generated on Mon 06-Jul-2009 14:16:10 by m2html © 2003