Home > functions > device > meg > vb_meginfo_get_sensor_weight_refmg.m

vb_meginfo_get_sensor_weight_refmg

PURPOSE ^

MEGinfo getter for sensor weight

SYNOPSIS ^

function [s_weight] = vb_meginfo_get_sensor_weight_refmg(meg_info)

DESCRIPTION ^

 MEGinfo getter for sensor weight
 [usage]
   [s_weight] = vb_meginfo_get_sensor_weight_refmg(meg_info)
 [input]
   meg_info : <required> <<struct>> MEGinfo
 [output]
   s_weight : value of sensor weight of reference channel [n_ch_ref x 1]
 [note]
   if the given MEGinfo does not have an appropriate field, return empty
   (new format) MEGinfo.device_info.sensor_weight_ref
 [history]
   2007-07-12 (Sako) initial version
   2011-07-20 (Sako) modified according to the new format

 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 [s_weight] = vb_meginfo_get_sensor_weight_refmg(meg_info)
0002 % MEGinfo getter for sensor weight
0003 % [usage]
0004 %   [s_weight] = vb_meginfo_get_sensor_weight_refmg(meg_info)
0005 % [input]
0006 %   meg_info : <required> <<struct>> MEGinfo
0007 % [output]
0008 %   s_weight : value of sensor weight of reference channel [n_ch_ref x 1]
0009 % [note]
0010 %   if the given MEGinfo does not have an appropriate field, return empty
0011 %   (new format) MEGinfo.device_info.sensor_weight_ref
0012 % [history]
0013 %   2007-07-12 (Sako) initial version
0014 %   2011-07-20 (Sako) modified according to the new format
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('meg_info', 'var'), meg_info = []; end
0021 [meg_info] = inner_check_arguments(meg_info);
0022 
0023 % --- MAIN PROCEDURE --------------------------------------------------------- %
0024 %
0025 s_weight = [];
0026 
0027 % --- old format
0028 if isfield(meg_info, 'sensor_weight_ref')
0029   warning('(%s) "MEGinfo.sensor_weight_rf" is old format\n', mfilename);
0030   s_weight = meg_info.sensor_weight_ref;
0031 end
0032 
0033 if ~isfield(meg_info, 'device_info'), return; end
0034 if ~isfield(meg_info.device_info, 'sensor_weight_ref'), return; end
0035 s_weight = meg_info.device_info.sensor_weight_ref;
0036 return;
0037 %
0038 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0039 
0040 % --- INNER FUNCTIONS -------------------------------------------------------- %
0041 %
0042 % --- inner_check_arguments()
0043 %
0044 function [meg_info] = inner_check_arguments(meg_info)
0045 func_ = mfilename;
0046 
0047 if isempty(meg_info)
0048   error('(%s)meg_info is a required parameter', func_);
0049 end
0050 return;
0051 %
0052 % --- end of inner_check_arguments()
0053 %
0054 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0055 
0056 % --- END OF FILE --- %

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