return eeg data which is saved as an internal parameter in EEG-MAT file [usage] eeg_data = vb_eegfile_load_internal_data(eegfile) [input] eegfile : <required> <<file>> EEG-MAT file [output] eegdata : EEG data [Nchannel x Nsample x Ntrial] [note] [history] 2008-02-29 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function eegdata = vb_eegfile_load_internal_data(eegfile) 0002 % return eeg data which is saved as an internal parameter in EEG-MAT file 0003 % [usage] 0004 % eeg_data = vb_eegfile_load_internal_data(eegfile) 0005 % [input] 0006 % eegfile : <required> <<file>> EEG-MAT file 0007 % [output] 0008 % eegdata : EEG data [Nchannel x Nsample x Ntrial] 0009 % [note] 0010 % 0011 % [history] 0012 % 2008-02-29 (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('eegfile', 'var'), eegfile = ''; end 0019 [eegfile] = inner_check_arguments(eegfile); 0020 0021 % --- MAIN PROCEDURE --------------------------------------------------------- % 0022 % 0023 eeg = load(eegfile); 0024 if isfield(eeg, 'eeg_data') 0025 eegdata = eeg.eeg_data; 0026 else 0027 eegdata = []; 0028 end 0029 return; 0030 % 0031 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0032 0033 0034 % --- INNER FUNCTIONS -------------------------------------------------------- % 0035 % 0036 % --- inner_check_arguments() 0037 % 0038 function [eegfile] = inner_check_arguments(eegfile) 0039 func_ = mfilename; 0040 if isempty(eegfile) 0041 error('(%s)eegfile is a required parameter', func_); 0042 end 0043 0044 if exist(eegfile, 'file') ~= 2 0045 error('(%s)cannot find eegfile: %s', func_, eegfile); 0046 end 0047 return; 0048 % 0049 % --- end of inner_check_arguments() 0050 % 0051 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0052 0053 %%% END OF FILE %%%