Be the first to rate this file! 11 Downloads (last 30 days) File Size: 1.71 KB File ID: #41000

MetricPrefixStr - Print SI Prefix Formatted Numbers

by

 

Prints a SI prefix formatted string corresponding to a numeric vector.

| Watch this File

File Information
Description

Author: Damon Bradley
Purpose: Print out formatted string using SI prefixes to clean up plots
for quantities in the thousands, millions, billions and trillions. This is useful for
publication-quality plots.

Version 1.0, March 28, 2013

INPUTS: xtickvec - Any vector of numbers
OUTPUTS: str - An array of strings with properly formatted numbers

USAGE EXAMPLE:

labels = MetricPrefixStr([1 10 100 33.64 1000 2000 40000 340000 7000000 1e14])

labels =

'1' '10' '100' '33.64' '1k' '2k' '40k' '340k' '7M' '100T'

class labels
 
ans =

char

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us