Home > vbmeg > functions > device > eeg > vb_eeginfo_get_sensor_number.m

vb_eeginfo_get_sensor_number

PURPOSE ^

return number of sensor

SYNOPSIS ^

function [Nch] = vb_eeginfo_get_sensor_number(eeginfo, active_swt)

DESCRIPTION ^

 return number of sensor
 [usage]
   [Nch] = vb_eeginfo_get_sensor_number(eeginfo, active_swt)
 [input]
      eeginfo : <required> <<struct>> EEGinfo which includes Coord
   active_swt : <optional> <<boolean>> [false]
              :  switch to return whether all the channels or only active
              :   true) only active channels
              :  false) all the channels
 [output]
          Nch : number of used channels
 [note]

 [history]
   2008-05-01 (Sako) initial version

 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 [Nch] = vb_eeginfo_get_sensor_number(eeginfo, active_swt)
0002 % return number of sensor
0003 % [usage]
0004 %   [Nch] = vb_eeginfo_get_sensor_number(eeginfo, active_swt)
0005 % [input]
0006 %      eeginfo : <required> <<struct>> EEGinfo which includes Coord
0007 %   active_swt : <optional> <<boolean>> [false]
0008 %              :  switch to return whether all the channels or only active
0009 %              :   true) only active channels
0010 %              :  false) all the channels
0011 % [output]
0012 %          Nch : number of used channels
0013 % [note]
0014 %
0015 % [history]
0016 %   2008-05-01 (Sako) initial version
0017 %
0018 % Copyright (C) 2011, ATR All Rights Reserved.
0019 % License : New BSD License(see VBMEG_LICENSE.txt)
0020 
0021 % --- CHECK ARGUMENTS --- %
0022 if ~exist('eeginfo', 'var'), eeginfo = []; end
0023 if ~exist('active_swt', 'var'), active_swt = []; end
0024 [eeginfo, active_swt] = inner_check_arguments(eeginfo, active_swt);
0025 
0026 % --- MAIN PROCEDURE --------------------------------------------------------- %
0027 %
0028 sensor_pos = vb_eeginfo_get_sensor_position(eeginfo, active_swt);
0029 Nch = size(sensor_pos, 1);
0030 return;
0031 %
0032 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0033 
0034 % --- INNER FUNCTIONS -------------------------------------------------------- %
0035 %
0036 % --- inner_check_arguments()
0037 %
0038 function [eeginfo, active_swt] = inner_check_arguments(eeginfo, active_swt)
0039 func_ = mfilename;
0040 if isempty(eeginfo)
0041   error('(%s)eeginfo is a required parameter', func_);
0042 end
0043 
0044 if ~isfield(eeginfo, 'Coord')
0045   eeginfo.Coord = [];
0046 end
0047 
0048 if isempty(active_swt)
0049   active_swt = false;
0050 end
0051 %
0052 % --- end of inner_check_arguments()
0053 %
0054 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0055 
0056 %%% END OF FILE %%%

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