⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 show_precision.m

📁 实现地震勘探中
💻 M
字号:
function show_precision(ds)% Function checks numeric fields of specific structures (seismic, well log, % table, pseudo-wells) to see if they have all the same precision.%% Written by: E. R.: December 31, 2006% Last updated: January 7, 2007: Generalize for dataset vectors% %      ds=show_precision(ds)% INPUT% ds   dataset of type "seismic', "well_log", "table",' or "pseudo-well"%% EXAMPLE%    show_precision(s_data)if nargin ~= 1   error(' One input argument is required.')endif strcmp(ds(1).type,'seismic')	 ||  strcmp(ds(1).type,'well_log') ...                                 ||  strcmp(ds(1).type,'table') ...                                 ||  strcmp(ds(1).type,'pseudo-wells')    lds=length(ds);   for jj=1:lds      fnames=fieldnames(ds(jj));      lfnames=length(fnames);      bool1=false(lfnames,1);      bool2=false(lfnames,1);      for ii=1:lfnames         if isa(ds(jj).(fnames{ii}),'double')            bool2(ii)=true;         elseif isa(ds(jj).(fnames{ii}),'single')            bool1(ii)=true;         end      end      if lds > 1         disp([' Dataset # ',num2str(jj),':'])      end      if any(bool1)         if any(bool2)   % Mixed precision            disp(' Single precision:')       	    disp(['   ',cell2str(fnames(bool1),', ')])            disp(' Double precision:')	    disp(['   ',cell2str(fnames(bool2),', ')])         else            disp(' Single precision')         end      else         disp(' Double precision')      end   end else   error('Function "same_precision" is not defined for this input argument.')end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -