Home > functions > default_param > vb_define_const.m

vb_define_const

PURPOSE ^

return defined constants variables

SYNOPSIS ^

function const_val = vb_define_const(measurement)

DESCRIPTION ^

 return defined constants variables
 [usage]
   const_val = vb_define_const(measurement);
 [input]
   measurement : <optional> measurement string 'MEG' or 'EEG' for now ['MEG']
               :  case-insensitive
 [output]
     const_val : struct of constants
 [note]

 [history]
   2009-07-27 (Sako) modified to define accordance with measurement
   2009-10-14 (Sako) added 'USER' type

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function const_val = vb_define_const(measurement)
0002 % return defined constants variables
0003 % [usage]
0004 %   const_val = vb_define_const(measurement);
0005 % [input]
0006 %   measurement : <optional> measurement string 'MEG' or 'EEG' for now ['MEG']
0007 %               :  case-insensitive
0008 % [output]
0009 %     const_val : struct of constants
0010 % [note]
0011 %
0012 % [history]
0013 %   2009-07-27 (Sako) modified to define accordance with measurement
0014 %   2009-10-14 (Sako) added 'USER' type
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 % --- CHECK ARGUMENTS --- %
0020 if ~exist('measurement', 'var'), measurement = ''; end
0021 [measurement] = inner_check_arguments(measurement);
0022 
0023 % --- MAIN PROCEDURE --------------------------------------------------------- %
0024 %
0025 % --- data type
0026 
0027 % ----- common type
0028 const_val.DATA_TYPE_ALL       = 'ALL';
0029 const_val.DATA_TYPE_EXTRA     = 'EXTRA';
0030 const_val.DATA_TYPE_USER      = 'USER';
0031 
0032 switch measurement
0033   case 'MEG'
0034     const_val.DATA_TYPE_MAIN      = 'MEG';
0035     const_val.DATA_TYPE_REFERENCE = 'REFERENCE';
0036     const_val.DATA_TYPE_AXIAL     = 'AXIAL';
0037     const_val.DATA_TYPE_PLANAR    = 'PLANAR';
0038 
0039   case 'EEG'
0040     const_val.DATA_TYPE_MAIN      = 'EEG';
0041   otherwise
0042     warning('(%s)unknown measurement : %s\n', mfilename, measurement);
0043 end
0044 return;
0045 %
0046 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0047 
0048 % --- INNER FUNCTIONS -------------------------------------------------------- %
0049 %
0050 % --- inner_check_arguments()
0051 %
0052 function [measurement] = inner_check_arguments(measurement)
0053 if isempty(measurement)
0054   measurement = 'MEG';
0055 else
0056   measurement = upper(measurement);
0057 end
0058 return;
0059 %
0060 % --- end of inner_check_arguments()
0061 %
0062 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0063 
0064 % --- END OF FILE --- %

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005