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

vb_eegfile_get_sensor_number

PURPOSE ^

return number of sensor

SYNOPSIS ^

function [Nch] = vb_eegfile_get_sensor_number(eegfile, active_swt)

DESCRIPTION ^

 return number of sensor
 [usage]
   [Nch] = vb_eegfile_get_sensor_number(eegfile, active_swt)
 [input]
      eegfile : <required> <<file>> EEG-MAT file
   active_swt : <optional> <<boolean>> [false] active filter switch
              :   true) return only active
              :  false) return all the channels
 [output]
          Nch : number of sensor
 [note]
   @see  vb_eeginfo_get_sensor_position  
 [history]
   2007-08-10 (Sako) initial version
   2008-05-01 (Sako) added active_swt

 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_eegfile_get_sensor_number(eegfile, active_swt)
0002 % return number of sensor
0003 % [usage]
0004 %   [Nch] = vb_eegfile_get_sensor_number(eegfile, active_swt)
0005 % [input]
0006 %      eegfile : <required> <<file>> EEG-MAT file
0007 %   active_swt : <optional> <<boolean>> [false] active filter switch
0008 %              :   true) return only active
0009 %              :  false) return all the channels
0010 % [output]
0011 %          Nch : number of sensor
0012 % [note]
0013 %   @see  vb_eeginfo_get_sensor_position
0014 % [history]
0015 %   2007-08-10 (Sako) initial version
0016 %   2008-05-01 (Sako) added active_swt
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('eegfile', 'var'), eegfile = []; end
0023 if ~exist('active_swt', 'var'), active_swt = []; end
0024 [eegfile, active_swt] = inner_check_arguments(eegfile, active_swt);
0025 
0026 % --- MAIN PROCEDURE --------------------------------------------------------- %
0027 %
0028 Coord = vb_eegfile_get_sensor_position(eegfile, active_swt);
0029 Nch = size(Coord,1);
0030 return;
0031 %
0032 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0033 
0034 % --- INNER FUNCTIONS -------------------------------------------------------- %
0035 %
0036 % --- inner_check_arguments()
0037 %
0038 function [eegfile, active_swt] = inner_check_arguments(eegfile, active_swt)
0039 func_ = mfilename;
0040 if isempty(eegfile)
0041   error('(%s)eegfile is a required parameter', func_);
0042 end
0043 
0044 if exist(eegfile, 'file') ~= 2
0045   error('(%s)cannot find eegfile : %s', func_, eegfile);
0046 end
0047 
0048 if isempty(active_swt)
0049   active_swt = false;
0050 end
0051 return;
0052 %
0053 % --- end of inner_check_arguments()
0054 %
0055 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0056 
0057 %%% END OF FILE %%%

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