return precision of binary data [usage] [prec] = vb_meginfo_get_precision(meginfo) [input] meginfo : <required> <<struct>> MEG information [output] prec : precision used by fread or fwrite [note] precision is used by fread or fwrite if meginfo does not have saveman field, return empty string ('') @see vb_saveman_get_precision() [history] 2007-06-25 (Sako) initial version Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [prec] = vb_meginfo_get_precision(meginfo) 0002 % return precision of binary data 0003 % [usage] 0004 % [prec] = vb_meginfo_get_precision(meginfo) 0005 % [input] 0006 % meginfo : <required> <<struct>> MEG information 0007 % [output] 0008 % prec : precision used by fread or fwrite 0009 % [note] 0010 % precision is used by fread or fwrite 0011 % if meginfo does not have saveman field, return empty string ('') 0012 % @see vb_saveman_get_precision() 0013 % [history] 0014 % 2007-06-25 (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('meginfo', 'var'), meginfo = []; end 0021 [meginfo] = inner_check_arguments(meginfo); 0022 0023 % --- MAIN PROCEDURE --------------------------------------------------------- % 0024 % 0025 prec = meginfo.saveman.precision; 0026 % 0027 % --- END OF MAIN PROCEDURE -------------------------------------------------- % 0028 0029 % --- INNER FUNCTIONS -------------------------------------------------------- % 0030 % 0031 % --- inner_check_arguments() 0032 % 0033 function [meginfo] = inner_check_arguments(meginfo) 0034 0035 func_ = 'vb_meginfo_get_precision'; 0036 0037 if isempty(meginfo) 0038 error('(%s)meginfo is a required parameter', func_); 0039 end 0040 0041 if ~isfield(meginfo, 'saveman') || ~isfield(meginfo.saveman, 'precision') 0042 meginfo.saveman.precision = ''; 0043 end 0044 return; 0045 % 0046 % --- end of inner_check_arguments() 0047 % 0048 % --- END OF INNER FUNCTIONS ------------------------------------------------- % 0049 0050 %--- END OF FILE ---%