Home > vbmeg > external > mne > fiff_write_raw_buffer.m

fiff_write_raw_buffer

PURPOSE ^

SYNOPSIS ^

function fiff_write_raw_buffer(fid,buf,cals)

DESCRIPTION ^

 function fiff_write_raw_buffer(fid,info,buf)

 fid        of an open raw data file
 buf        the buffer to write
 cals       calibration factors

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fiff_write_raw_buffer(fid,buf,cals)
0002 %
0003 % function fiff_write_raw_buffer(fid,info,buf)
0004 %
0005 % fid        of an open raw data file
0006 % buf        the buffer to write
0007 % cals       calibration factors
0008 %
0009 %
0010 
0011 %
0012 %   Author : Matti Hamalainen, MGH Martinos Center
0013 %   License : BSD 3-clause
0014 %
0015 % Revision 1.1  2007/11/07 16:05:05  msh
0016 % New routines for writing raw files
0017 %
0018 
0019 me='MNE:fiff_write_raw_buffer';
0020 if nargin ~= 3
0021     error(me,'Incorrect number of arguments');
0022 end
0023 
0024 if size(buf,1) ~= length(cals)
0025     error(me,'buffer and calibration sizes do not match');
0026 end
0027 
0028 global FIFF;
0029 if isempty(FIFF)
0030     FIFF = fiff_define_constants();
0031 end
0032 
0033 fiff_write_float(fid,FIFF.FIFF_DATA_BUFFER,inv(diag(cals))*buf); % XXX why not diag(1./cals) ???
0034 
0035 return;

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