MEGinfo getter for sensor weight [usage] [weight] = vb_meginfo_get_sensor_weight_meg(meginfo) [input] meginfo : <required> <<struct>> MEG information [output] weight : value of sensor weight of MEG [note] if the given MEGinfo does not have an appropriate field, return empty [history] 2007-07-12 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [weight] = vb_meginfo_get_sensor_weight_meg(meginfo) 0002 % MEGinfo getter for sensor weight 0003 % [usage] 0004 % [weight] = vb_meginfo_get_sensor_weight_meg(meginfo) 0005 % [input] 0006 % meginfo : <required> <<struct>> MEG information 0007 % [output] 0008 % weight : value of sensor weight of MEG 0009 % [note] 0010 % if the given MEGinfo does not have an appropriate field, return empty 0011 % [history] 0012 % 2007-07-12 (Sako) initial version 0013 % 0014 % Copyright (C) 2011, ATR All Rights Reserved. 0015 % License : New BSD License(see VBMEG_LICENSE.txt) 0016 0017 % --- CHECK ARGUMENTS --- % 0018 if ~exist('meginfo', 'var') meginfo = []; end 0019 [meginfo] = inner_check_arguments(meginfo); 0020 0021 % --- MAIN PROCEDURE --------------------------------------------------------- % 0022 % 0023 weight = meginfo.sensor_weight; 0024 return; 0025 % 0026 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0027 0028 % --- INNER FUNCTIONS -------------------------------------------------------- % 0029 % 0030 % --- inner_check_arguments() 0031 % 0032 function [meginfo] = inner_check_arguments(meginfo) 0033 0034 func_ = mfilename; 0035 0036 if isempty(meginfo) 0037 error('(%s)meginfo is a required parameter', func_); 0038 end 0039 0040 if ~isfield(meginfo, 'sensor_weight') 0041 meginfo.sensor_weight = []; 0042 end 0043 return; 0044 % 0045 % --- end of inner_check_arguments() 0046 % 0047 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0048 0049 %%% END OF FILE %%%