<<getter>> return number of sample from EEGinfo [usage] [n_sample] = vb_eeginfo_get_sample_number(eeginfo) [input] eeginfo : <required> <<struct>> EEGinfo [output] n_sample : number of sample [note] [history] 2008-02-26 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [n_sample] = vb_eeginfo_get_sample_number(eeginfo) 0002 % <<getter>> return number of sample from EEGinfo 0003 % [usage] 0004 % [n_sample] = vb_eeginfo_get_sample_number(eeginfo) 0005 % [input] 0006 % eeginfo : <required> <<struct>> EEGinfo 0007 % [output] 0008 % n_sample : number of sample 0009 % [note] 0010 % 0011 % [history] 0012 % 2008-02-26 (Sako) initial version 0013 % 0014 % Copyright (C) 2011, ATR All Rights Reserved. 0015 % License : New BSD License(see VBMEG_LICENSE.txt) 0016 0017 % --- CHECK ARGUMENTS --- % 0018 if ~exist('eeginfo', 'var'), eeginfo = []; end 0019 [eeginfo] = inner_check_arguments(eeginfo); 0020 0021 % --- MAIN PROCEDURE --------------------------------------------------------- % 0022 % 0023 if ~isfield(eeginfo, 'Nsample') 0024 n_sample = 0; 0025 else 0026 n_sample = eeginfo.Nsample; 0027 end 0028 return; 0029 % 0030 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0031 0032 % --- INNER FUNCTIONS -------------------------------------------------------- % 0033 % 0034 % --- inner_check_arguments() 0035 % 0036 function [eeginfo] = inner_check_arguments(eeginfo) 0037 func_ = mfilename; 0038 if isempty(eeginfo) 0039 error('(%s)eeginfo is a required parameter', func_); 0040 end 0041 return; 0042 % 0043 % --- end of inner_check_arguments() 0044 % 0045 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0046 0047 0048 0049 %%% END OF FILE %%%