Home > bml > annot > bml_annot_write.m

bml_annot_write

PURPOSE ^

BML_ANNOT_WRITE writes an annotation table

SYNOPSIS ^

function bml_annot_write(annot,filename,varargin)

DESCRIPTION ^

 BML_ANNOT_WRITE writes an annotation table

 Use as
   bml_annot_write(annot,'annot/MyAnnot.txt')

 annot - annotation table to write
 filename - char or string indicating file to load
 varargin - further arguments for writetable

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function bml_annot_write(annot,filename,varargin)
0002 
0003 % BML_ANNOT_WRITE writes an annotation table
0004 %
0005 % Use as
0006 %   bml_annot_write(annot,'annot/MyAnnot.txt')
0007 %
0008 % annot - annotation table to write
0009 % filename - char or string indicating file to load
0010 % varargin - further arguments for writetable
0011 
0012 annot = bml_annot_table(annot,[],inputname(1));
0013 
0014 if ~exist('filename','var')
0015   if isempty(annot.Properties.Description)
0016     error("filename required");
0017   else
0018     filename = fullfile(pwd,annot.Properties.Description,'.txt');
0019     fprintf("writing annot table in %s\n",filename);
0020   end
0021 end
0022 
0023 if ~ismember('delimiter',varargin)
0024   varargin = [varargin, {'delimiter','\t'}];
0025 end
0026 
0027 writetable(annot,filename,varargin{:});
0028

Generated on Tue 25-Sep-2018 10:08:19 by m2html © 2005