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