units2tex.m

来自「基于Matlab的地震数据处理显示和测井数据显示于处理的小程序」· M 代码 · 共 30 行

M
30
字号
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. R., 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 measurementif 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' ,'');   endend

⌨️ 快捷键说明

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