Home > vbmeg > functions > device > meg > vb_megfile_get_internal_data_meg.m

vb_megfile_get_internal_data_meg

PURPOSE ^

return meg data which is internally stored in megfile

SYNOPSIS ^

function [bexp] = vb_megfile_get_internal_data_meg(megfile)

DESCRIPTION ^

 return meg data which is internally stored in megfile
 [usage]
   [bexp] = vb_megfile_get_internal_data_meg(megfile)
 [input]
    megfile : <required> <<file>> MEG-MAT file
 [output]
       bexp : matrix of bexp field stored in MEG-MAT file
            : [Nchannel x Nsample x Ntrial]
 [note]
   MEG-MAT must have bexp field even if it is empty
   This function does not provide data which is selected in sample and trial
 [history]
   2008-02-15 (Sako) initial version

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [bexp] = vb_megfile_get_internal_data_meg(megfile)
0002 % return meg data which is internally stored in megfile
0003 % [usage]
0004 %   [bexp] = vb_megfile_get_internal_data_meg(megfile)
0005 % [input]
0006 %    megfile : <required> <<file>> MEG-MAT file
0007 % [output]
0008 %       bexp : matrix of bexp field stored in MEG-MAT file
0009 %            : [Nchannel x Nsample x Ntrial]
0010 % [note]
0011 %   MEG-MAT must have bexp field even if it is empty
0012 %   This function does not provide data which is selected in sample and trial
0013 % [history]
0014 %   2008-02-15 (Sako) initial version
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 % --- CHECK ARGUMENTS --- %
0020 if ~exist('megfile', 'var'), megfile = []; end
0021 [megfile] = inner_check_arguments(megfile);
0022 
0023 % --- MAIN PROCEDURE --------------------------------------------------------- %
0024 %
0025 func_ = mfilename;
0026 
0027 load(megfile, 'bexp');
0028 if ~exist('bexp', 'var')
0029   warning('(%s)This megfile does not have bexp field\n', func_);
0030   bexp = [];
0031 end
0032 return;
0033 %
0034 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0035 
0036 % --- INNER FUNCTIONS -------------------------------------------------------- %
0037 %
0038 % --- inner_check_arguments()
0039 %
0040 function [megfile] = inner_check_arguments(megfile)
0041 func_ = mfilename;
0042 
0043 if isempty(megfile)
0044   error('(%s)megfile is a required parameter', func_);
0045 end
0046 
0047 if exist(megfile, 'file') ~= 2
0048   error('(%s)cannot find megfile : %s', func_, megfile);
0049 end
0050 return;
0051 %
0052 % --- end of inner_check_arguments()
0053 %
0054 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0055 
0056 %%% END OF FILE %%%

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005