Home > vbmeg > functions > device > vb_info_get_trial_number.m

vb_info_get_trial_number

PURPOSE ^

return number of trial from info (MEGinfo or EEGinfo) struct

SYNOPSIS ^

function n_trial = vb_info_get_trial_number(info, active_swt)

DESCRIPTION ^

 return number of trial from info (MEGinfo or EEGinfo) struct
 [usage]
   n_trial = vb_info_get_trial_number(info, active_swt)
 [input]
         info : <required> <<struct>> MEGinfo or EEGinfo for now
   active_swt : <optional> <<boolean>> [false]
              :  target trials are whether only active or all
              :    true) active trial
              :   false) all the trial
 [output]
      n_trial : number of trial
 [note]
   @see vb_info_get_trial_list
   this function is vb_info_get_Nrepeat + active_swt
 [history]
   2008-04-15 (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 n_trial = vb_info_get_trial_number(info, active_swt)
0002 % return number of trial from info (MEGinfo or EEGinfo) struct
0003 % [usage]
0004 %   n_trial = vb_info_get_trial_number(info, active_swt)
0005 % [input]
0006 %         info : <required> <<struct>> MEGinfo or EEGinfo for now
0007 %   active_swt : <optional> <<boolean>> [false]
0008 %              :  target trials are whether only active or all
0009 %              :    true) active trial
0010 %              :   false) all the trial
0011 % [output]
0012 %      n_trial : number of trial
0013 % [note]
0014 %   @see vb_info_get_trial_list
0015 %   this function is vb_info_get_Nrepeat + active_swt
0016 % [history]
0017 %   2008-04-15 (Sako) initial version
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 % --- CHECK ARGUMENTS --- %
0023 if ~exist('info', 'var'), info = []; end
0024 if ~exist('active_swt', 'var'), active_swt = []; end
0025 [info, active_swt] = inner_check_arguments(info, active_swt);
0026 
0027 % --- MAIN PROCEDURE --------------------------------------------------------- %
0028 %
0029 trial_list = vb_info_get_trial_list(info, [], active_swt);
0030 n_trial = length(trial_list);
0031 return;
0032 %
0033 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0034 
0035 % --- INNER FUNCTIONS -------------------------------------------------------- %
0036 %
0037 % --- inner_check_arguments()
0038 %
0039 function [info, active_swt] = inner_check_arguments(info, active_swt)
0040 func_ = mfilename;
0041 if isempty(info)
0042   error('(%s)info is a required parameter', func_);
0043 end
0044 
0045 if isempty(active_swt)
0046   active_swt = false;
0047 end
0048 return;
0049 %
0050 % --- end of inner_check_arguments()
0051 %
0052 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0053 
0054 %%% END OF FILE %%%

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