return record time from EEGinfo [usage] [rec_time] = vb_eeginfo_get_rectime(eeginfo) [input] eeginfo : <required> <<struct>> EEGinfo [output] rec_time : record time [sec] [note] device dependent data [history] 2011-05-27 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [rec_time] = vb_eeginfo_get_rectime(eeginfo) 0002 % return record time from EEGinfo 0003 % [usage] 0004 % [rec_time] = vb_eeginfo_get_rectime(eeginfo) 0005 % [input] 0006 % eeginfo : <required> <<struct>> EEGinfo 0007 % [output] 0008 % rec_time : record time [sec] 0009 % [note] 0010 % device dependent data 0011 % [history] 0012 % 2011-05-27 (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 rec_time = []; 0024 0025 if isfield(eeginfo, 'device_info') 0026 if isfield(eeginfo.device_info, 'RecordTime') 0027 rec_time = eeginfo.device_info.RecordTime; 0028 else 0029 % warning('device_info does not have ''RecordTime'' field\n'); 0030 end 0031 else 0032 if isfield(eeginfo, 'RecordTime') 0033 rec_time = eeginfo.RecordTime; 0034 else 0035 % warning('eeginfo does not have ''RecordTime'' field\n'); 0036 end 0037 end 0038 return; 0039 % 0040 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0041 0042 % --- INNER FUNCTIONS -------------------------------------------------------- % 0043 % 0044 % --- inner_check_arguments() 0045 % 0046 function [eeginfo] = inner_check_arguments(eeginfo) 0047 func_ = mfilename; 0048 0049 if isempty(eeginfo) 0050 error('(%s)eeginfo is a required parameter', func_); 0051 end 0052 return; 0053 % 0054 % --- end of inner_check_arguments() 0055 % 0056 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0057 0058 %--- END OF FILE ---%