Home > vbmeg > 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
   2022-06-03 (k_suzuki) added OPM' to measurement

 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 %   2022-06-03 (k_suzuki) added OPM' to measurement
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 % --- CHECK ARGUMENTS --- %
0021 if ~exist('measurement', 'var'), measurement = ''; end
0022 [measurement] = inner_check_arguments(measurement);
0023 
0024 % --- MAIN PROCEDURE --------------------------------------------------------- %
0025 %
0026 % --- data type
0027 
0028 % ----- common type
0029 const_val.DATA_TYPE_ALL       = 'ALL';
0030 const_val.DATA_TYPE_EXTRA     = 'EXTRA';
0031 const_val.DATA_TYPE_USER      = 'USER';
0032 
0033 switch measurement
0034   case 'MEG'
0035     const_val.DATA_TYPE_MAIN      = 'MEG';
0036     const_val.DATA_TYPE_REFERENCE = 'REFERENCE';
0037     const_val.DATA_TYPE_MAG       = 'MAG';
0038     const_val.DATA_TYPE_AXIAL     = 'AXIAL';
0039     const_val.DATA_TYPE_PLANAR    = 'PLANAR';
0040 
0041     % For OPM (QZFM) device
0042     const_val.DATA_TYPE_MAG_X     = 'MAG_X';
0043     const_val.DATA_TYPE_MAG_Y     = 'MAG_Y';
0044     const_val.DATA_TYPE_MAG_Z     = 'MAG_Z';
0045       
0046   case 'EEG'
0047     const_val.DATA_TYPE_MAIN      = 'EEG';
0048   case 'INFO'
0049     const_val.DATA_TYPE_MAIN      = 'INFO';
0050   otherwise
0051     warning('(%s)unknown measurement : %s\n', mfilename, measurement);
0052 end
0053 return;
0054 %
0055 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0056 
0057 % --- INNER FUNCTIONS -------------------------------------------------------- %
0058 %
0059 % --- inner_check_arguments()
0060 %
0061 function [measurement] = inner_check_arguments(measurement)
0062 if isempty(measurement)
0063   measurement = 'MEG';
0064 else
0065   measurement = upper(measurement);
0066 end
0067 return;
0068 %
0069 % --- end of inner_check_arguments()
0070 %
0071 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0072 
0073 % --- END OF FILE --- %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005