Home > vbmeg > functions > device > acqdata > vb_posfile_remake_datafile.m

vb_posfile_remake_datafile

PURPOSE ^

remake MEG-MAT or EEG-MAT file by loading posfile

SYNOPSIS ^

function [result] = vb_posfile_remake_datafile(pos_file, data_file, new_file)

DESCRIPTION ^

 remake MEG-MAT or EEG-MAT file by loading posfile
 [usage]
   [result] = vb_posfile_remake_datafile(pos_file, data_file, new_file)
 [input]
   pos_file : <required> <<file>> POS-MAT file
  data_file : <required> <<file>> MEG-MAT or EEG_MAT file
   new_file : <optional> new file name if you want [(update data_file)]
 [output]
     result : result code
            :  0) no problem
            : >1) something wrong
            :      1) bad pos_file
            :      2) bad data_file
 [note]
   @see vb_posfile_remake_megfile.m
   @see vb_posfile_remake_eegfile.m

 [history]
   2009-08-05 (Sako) initial version
   2011-06-01 (Sako) converted return values of vb_load_device to upper case

 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:

SOURCE CODE ^

0001 function [result] = vb_posfile_remake_datafile(pos_file, data_file, new_file)
0002 % remake MEG-MAT or EEG-MAT file by loading posfile
0003 % [usage]
0004 %   [result] = vb_posfile_remake_datafile(pos_file, data_file, new_file)
0005 % [input]
0006 %   pos_file : <required> <<file>> POS-MAT file
0007 %  data_file : <required> <<file>> MEG-MAT or EEG_MAT file
0008 %   new_file : <optional> new file name if you want [(update data_file)]
0009 % [output]
0010 %     result : result code
0011 %            :  0) no problem
0012 %            : >1) something wrong
0013 %            :      1) bad pos_file
0014 %            :      2) bad data_file
0015 % [note]
0016 %   @see vb_posfile_remake_megfile.m
0017 %   @see vb_posfile_remake_eegfile.m
0018 %
0019 % [history]
0020 %   2009-08-05 (Sako) initial version
0021 %   2011-06-01 (Sako) converted return values of vb_load_device to upper case
0022 %
0023 % Copyright (C) 2011, ATR All Rights Reserved.
0024 % License : New BSD License(see VBMEG_LICENSE.txt)
0025 
0026 if nargin < 3
0027     new_file = '';
0028 end
0029 
0030 [measurement] = vb_load_device(data_file);
0031 Measurement = upper(measurement);
0032 
0033 switch Measurement
0034   case 'MEG'
0035     result = vb_posfile_remake_megfile(pos_file, data_file, new_file);
0036   case 'EEG'
0037     result = vb_posfile_remake_eegfile(pos_file, data_file, new_file);
0038   otherwise
0039     error('(%s) unknown Measurement : %s', mfilename, Measurement);
0040 end
0041 
0042 return;
0043 
0044 % --- END OF FILE --- %

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