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

vb_megfile_is_before_05b

PURPOSE ^

check megfile version before 0.5b or after

SYNOPSIS ^

function [result] = vb_megfile_is_before_05b(megfile)

DESCRIPTION ^

 check megfile version before 0.5b or after
 [usage]
   [result] = vb_megfile_is_before_05b(megfile)
 [input]
   megfile : <required> <<file>> MEG-MAT file
 [output]
    result : <<boolean>>
           :   true ) meg.mat file before 0.5b
           :  false ) meg.mat file after 0.5b
 [note]
   exceptional) the case that this megfile was made without pos-mat file
 [history]
   2009-04-16 (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 [result] = vb_megfile_is_before_05b(megfile)
0002 % check megfile version before 0.5b or after
0003 % [usage]
0004 %   [result] = vb_megfile_is_before_05b(megfile)
0005 % [input]
0006 %   megfile : <required> <<file>> MEG-MAT file
0007 % [output]
0008 %    result : <<boolean>>
0009 %           :   true ) meg.mat file before 0.5b
0010 %           :  false ) meg.mat file after 0.5b
0011 % [note]
0012 %   exceptional) the case that this megfile was made without pos-mat file
0013 % [history]
0014 %   2009-04-16 (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 meginfo = vb_megfile_load_meginfo(megfile);
0026 transinfo = vb_info_get_transinfo(meginfo);
0027 
0028 if isempty(transinfo)
0029 
0030   load(megfile, 'CoordType');
0031   if ~exist('CoordType', 'var')
0032     fprintf('(05b_OR_BEFORE) this megfile may be made without pos-mat file\n');
0033     result = true;
0034     return;
0035   else
0036     fprintf('(AFTER_06_A) coordinate type is %s\n', CoordType);
0037     result = false;
0038     return;
0039   end
0040 
0041 else
0042   fprintf('(AFTER_06_A) I found MEGinfo.TransInfo\n');
0043   result = false;
0044 end
0045 return;
0046 %
0047 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0048 
0049 % --- INNER FUNCTIONS -------------------------------------------------------- %
0050 %
0051 % --- inner_check_arguments()
0052 %
0053 function [megfile] = inner_check_arguments(megfile)
0054 func_ = mfilename;
0055 if isempty(megfile)
0056   error('(%s) megfile is a required parameter', func_);
0057 end
0058 
0059 if exist(megfile, 'file') ~= 2
0060   error('(%s) cannot find megfile : %s', func_, megfile);
0061 end
0062 return;
0063 %
0064 % --- end of inner_check_arguments()
0065 %
0066 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0067 
0068 % --- END OF FILE --- %

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