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

vb_megfile_load_meginfo

PURPOSE ^

load MEGinfo struct from megfile and return it

SYNOPSIS ^

function MEGinfo = vb_megfile_load_meginfo(megfile)

DESCRIPTION ^

 load MEGinfo struct from megfile and return it
 [usage]
   meginfo = vb_megfile_load_meginfo(megfile)
 [input]
    megfile : <required> <<file>> MEG-MAT file
 [output]
   MEGinfo : <<struct>> MEG information
 [note]
   
 [history]
   2007-05-25 (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 MEGinfo = vb_megfile_load_meginfo(megfile)
0002 % load MEGinfo struct from megfile and return it
0003 % [usage]
0004 %   meginfo = vb_megfile_load_meginfo(megfile)
0005 % [input]
0006 %    megfile : <required> <<file>> MEG-MAT file
0007 % [output]
0008 %   MEGinfo : <<struct>> MEG information
0009 % [note]
0010 %
0011 % [history]
0012 %   2007-05-25 (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 % --- MAIN PROCEDURE --------------------------------------------------------- %
0022 %
0023 MEGinfo = [];
0024 load(megfile, 'MEGinfo');
0025 return;
0026 %
0027 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0028 
0029 % --- INNER FUNCTIONS -------------------------------------------------------- %
0030 %
0031 % --- inner_check_arguments()
0032 %
0033 function [megfile] = inner_check_arguments(megfile)
0034 func_ = mfilename;
0035 if isempty(megfile)
0036   error('(%s)megfile is a required parameter', func_);
0037 end
0038 
0039 if exist(megfile, 'file') ~= 2
0040   error('(%s)cannot find megfile : %s', func_, megfile);
0041 end
0042 return;
0043 %
0044 % --- end of inner_check_arguments()
0045 %
0046 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0047   
0048 % --- END OF FILE --- %

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