Home > vbmeg > functions > device > vb_info_active_channel_is_valid.m

vb_info_active_channel_is_valid

PURPOSE ^

check whether active channel field is valid or not

SYNOPSIS ^

function [result] = vb_info_active_channel_is_valid(info)

DESCRIPTION ^

 check whether active channel field is valid or not
 [usage]
   [result] = vb_info_active_channel_is_valid(info)
 [input]
     info : <required> <<struct>> MEGinfo or EEGinfo
 [output]
   result : <<boolean>>
          :   true) valid
          :  false) invalid
 [note]
   for now, MEGinfo and EEGinfo has the same field name for active channel
   invalid conditions are as follows.
    * There is not the appropriate field
    * Active channel field is empty
    * The length of active channel is different from the number of sensor
 [history]
   2008-04-11 (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 [result] = vb_info_active_channel_is_valid(info)
0002 % check whether active channel field is valid or not
0003 % [usage]
0004 %   [result] = vb_info_active_channel_is_valid(info)
0005 % [input]
0006 %     info : <required> <<struct>> MEGinfo or EEGinfo
0007 % [output]
0008 %   result : <<boolean>>
0009 %          :   true) valid
0010 %          :  false) invalid
0011 % [note]
0012 %   for now, MEGinfo and EEGinfo has the same field name for active channel
0013 %   invalid conditions are as follows.
0014 %    * There is not the appropriate field
0015 %    * Active channel field is empty
0016 %    * The length of active channel is different from the number of sensor
0017 % [history]
0018 %   2008-04-11 (Sako) initial version
0019 %
0020 % Copyright (C) 2011, ATR All Rights Reserved.
0021 % License : New BSD License(see VBMEG_LICENSE.txt)
0022 
0023 % --- CHECK ARGUMENTS --- %
0024 if ~exist('info', 'var'), info = []; end
0025 [info] = inner_check_arguments(info);
0026 
0027 
0028 % --- MAIN PROCEDURE --------------------------------------------------------- %
0029 %
0030 result = false;
0031 if ~isfield(info, 'ActiveChannel') || isempty(info.ActiveChannel)
0032   return;
0033 end
0034 
0035 Nchannel = vb_info_get_Nchannel(info);
0036 len_active = length(info.ActiveChannel);
0037 if Nchannel ~= len_active
0038 %   fprintf('(%s)numbers are different Nchannel(%d) and ActiveChannel(%d)\n', ...
0039 %     mfilename, Nchannel, len_active);
0040   return;
0041 end
0042 
0043 result = true;
0044 return;
0045 %
0046 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0047 
0048 % --- INNER FUNCTIONS -------------------------------------------------------- %
0049 %
0050 % --- inner_check_arguments()
0051 %
0052 function [info] = inner_check_arguments(info)
0053 func_ = mfilename;
0054 if isempty(info)
0055   error('(%s)info is a required parameter', func_);
0056 end
0057 return;
0058 %
0059 % --- end of inner_check_arguments()
0060 %
0061 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0062 
0063 %%% END OF FILE %%%

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