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

📄 units2tex.m

📁 实现地震勘探中
💻 M
字号:
function uo=units2tex(ui)
% Function substitutes TeX-style units for input units that imply exponents or 
% greek letters (for axis annotation of plots)
% e.g. kg/m3 ==> kg/m^3
%
% Written by E. Rietsch, May, 6, 2000
% Last updated: November 12, 2005: Add "us" (for microseconds) as units to 
%                                  be converted to TeX-style
%
%        uo=units2tex(ui)
% INPUT
% ui     string or cell with input units of measurement
% OUTPUT
% uo     string with output units of measurement

if strcmp(ui,'n/a')
   uo='';

else
   if strcmp(ui,'us')
      uo='\mus';
   else
      uo=strrep(ui,'g/cm3','g/cm^3');
      uo=strrep(uo,'kg/m3','kg/m^3');
      uo=strrep(uo,'us/ft','\mus/ft');
      uo=strrep(uo,'us/m' ,'\mus/m');
%      uo=strrep(uo,'n/a' ,'');
   end
end

⌨️ 快捷键说明

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