Home > vbmeg > functions > device > vb_info_get_active_trial_index.m

vb_info_get_active_trial_index

PURPOSE ^

return active trial index list

SYNOPSIS ^

function [idx_list, result] = vb_info_get_active_trial_index(info)

DESCRIPTION ^

 return active trial index list
 [usage]
   [idx_list, result] = vb_info_get_active_trial_index(info)
 [input]
       info : <required> <<struct>> MEGinfo or EEGinfo
 [output]
   idx_list : [N_activeCh x 1] active trial index list
     result : <<integer>> error code
            :  0) success
            :  1) error - bad info
 [note]

 [history]
   2008-06-05 (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 [idx_list, result] = vb_info_get_active_trial_index(info)
0002 % return active trial index list
0003 % [usage]
0004 %   [idx_list, result] = vb_info_get_active_trial_index(info)
0005 % [input]
0006 %       info : <required> <<struct>> MEGinfo or EEGinfo
0007 % [output]
0008 %   idx_list : [N_activeCh x 1] active trial index list
0009 %     result : <<integer>> error code
0010 %            :  0) success
0011 %            :  1) error - bad info
0012 % [note]
0013 %
0014 % [history]
0015 %   2008-06-05 (Sako) initial version
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 % --- CHECK ARGUMENTS --- %
0021 if ~exist('info', 'var'), info = []; end
0022 [info, result] = inner_check_arguments(info);
0023 
0024 % --- MAIN PROCEDURE --------------------------------------------------------- %
0025 %
0026 if result ~= 0
0027   idx_list = [];
0028   return;
0029 end
0030 
0031 if vb_info_active_trial_is_valid(info)
0032   active_list = vb_info_get_active_trial(info);
0033   idx_list = find(active_list);
0034   return;
0035 end
0036 
0037 % --- no ActiveTrial field in info
0038 idx_list = 1:vb_info_get_Nrepeat(info);
0039 return;
0040 %
0041 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0042 
0043 % --- INNER FUNCTIONS -------------------------------------------------------- %
0044 %
0045 % --- inner_check_arguments()
0046 %
0047 function [info, result] = inner_check_arguments(info)
0048 result = 0;
0049 if isempty(info)
0050   fprintf('(%s)info is a required parameter\n', mfilename);
0051   result = 1;
0052   return;
0053 end
0054 return;
0055 %
0056 % --- end of inner_check_arguments()
0057 %
0058 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0059 
0060 %%% END OF FILE %%%

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