


fiff_write_named_matrix(fid,kind,mat)
Writes a named single-precision floating-point matrix
fid An open fif file descriptor
kind The tag kind to use for the data
mat The data matrix

0001 function fiff_write_named_matrix(fid,kind,mat) 0002 % 0003 % fiff_write_named_matrix(fid,kind,mat) 0004 % 0005 % Writes a named single-precision floating-point matrix 0006 % 0007 % fid An open fif file descriptor 0008 % kind The tag kind to use for the data 0009 % mat The data matrix 0010 % 0011 0012 % 0013 % 0014 % Author : Matti Hamalainen, MGH Martinos Center 0015 % License : BSD 3-clause 0016 % 0017 % Revision 1.5 2006/04/23 15:29:40 msh 0018 % Added MGH to the copyright 0019 % 0020 % Revision 1.4 2006/04/12 10:29:03 msh 0021 % Made evoked data writing compatible with the structures returned in reading. 0022 % 0023 % Revision 1.3 2006/04/10 23:26:54 msh 0024 % Added fiff reading routines 0025 % 0026 % Revision 1.2 2005/12/05 20:23:21 msh 0027 % Added fiff_save_evoked. Improved error handling. 0028 % 0029 % Revision 1.1 2005/12/05 16:01:04 msh 0030 % Added an initial set of fiff writing routines. 0031 % 0032 % 0033 0034 global FIFF; 0035 if isempty(FIFF) 0036 FIFF = fiff_define_constants(); 0037 end 0038 0039 me='MNE:fiff_write_named_matrix'; 0040 0041 if nargin ~= 3 0042 error(me,'Incorrect number of arguments'); 0043 end 0044 0045 fiff_start_block(fid,FIFF.FIFFB_MNE_NAMED_MATRIX); 0046 fiff_write_int(fid,FIFF.FIFF_MNE_NROW,mat.nrow); 0047 fiff_write_int(fid,FIFF.FIFF_MNE_NCOL,mat.ncol); 0048 if size(mat.row_names,2) > 0 0049 fiff_write_name_list(fid,FIFF.FIFF_MNE_ROW_NAMES,mat.row_names); 0050 end 0051 if size(mat.col_names,2) > 0 0052 fiff_write_name_list(fid,FIFF.FIFF_MNE_COL_NAMES,mat.col_names); 0053 end 0054 fiff_write_float_matrix(fid,kind,mat.data); 0055 fiff_end_block(fid,FIFF.FIFFB_MNE_NAMED_MATRIX); 0056 0057 return; 0058