return valid sampling frequency from MEG-MAT file [usage] [channel_list] = vb_megfile_get_sampling_frequency(megfile) [input] megfile : <required> <<file>> MEG-MAT file (*.meg.mat) [output] freq : value of sampling frequency [note] @see vb_meginfo_get_sampling_frequency.m [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_megfile_get_sampling_frequency(megfile) 0002 % return valid sampling frequency from MEG-MAT file 0003 % [usage] 0004 % [channel_list] = vb_megfile_get_sampling_frequency(megfile) 0005 % [input] 0006 % megfile : <required> <<file>> MEG-MAT file (*.meg.mat) 0007 % [output] 0008 % freq : value of sampling frequency 0009 % [note] 0010 % @see vb_meginfo_get_sampling_frequency.m 0011 % [history] 0012 % 2007-08-02 (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('megfile', 'var') megfile = []; end 0019 [megfile] = inner_check_arguments(megfile); 0020 0021 0022 % --- MAIN PROCEDURE --------------------------------------------------------- % 0023 % 0024 meginfo = vb_megfile_load_meginfo(megfile); 0025 freq = vb_meginfo_get_sampling_frequency(meginfo); 0026 return; 0027 % 0028 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0029 0030 % --- INNER FUNCTIONS -------------------------------------------------------- % 0031 % 0032 % --- inner_check_arguments() 0033 % 0034 function [megfile] = inner_check_arguments(megfile) 0035 func_ = mfilename; 0036 if isempty(megfile) 0037 error('(%s)megfile is a required parameter', func_); 0038 end 0039 0040 if exist(megfile, 'file') ~= 2 0041 error('(%s)cannot find megfile : %s', func_, megfile); 0042 end 0043 return; 0044 % 0045 % --- end of inner_check_arguments() 0046 0047 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0048 0049 %%% END OF FILE %%%