num2sci

version 1.0.0.0 (2.64 KB) by Jason Kaeding
Works just like num2str except will print with formatting in SI prefix notation.

689 Downloads

Updated Tue, 02 Mar 2010 19:45:56 +0000

View License

Works just like num2str except will print with formatting in SI prefix notation and (optional) units and precision.

Works with arrays of numbers and (potentially) cell arrays of strings for the units, returning a cell array of strings.

Examples:

str = num2sci(165.48e-3) returns str = '165.5 m'
str = num2sci(165.48e-3,'V') returns str = '165.5 mV'
str = num2sci(165.48e-3,'mV') returns str = '165.5 uV'
str = num2sci(165.48e-3,3,'V') returns str = '165 mV'
str = num2sci([1.5 2.5],{'V','mA'}) returns str = {'1.5 V' '2.5 mA'}

Cite As

Jason Kaeding (2022). num2sci (https://www.mathworks.com/matlabcentral/fileexchange/26827-num2sci), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!