Code covered by the BSD License  

Highlights from
Volume Browser, Release 1.03

image thumbnail
from Volume Browser, Release 1.03 by Eike Rietsch
GUI for visualization of data volumes via slices, contour lines, isosurfaces, and animation.

uo=units2tex(ui)
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

Contact us at files@mathworks.com