Code covered by the BSD License  

Highlights from

4.3 | 6 ratings Rate this file 13 Downloads (last 30 days) File Size: 1.53 KB File ID: #8361 Version: 1.0
image thumbnail




24 Aug 2005 (Updated )

Flexible number formatting using java.

| Watch this File

File Information

Here is a simple example how to use java.text to format numbers using similar syntax to Excel's. # for a number or space, 0 for a number or zero, etc...

I found this useful for plots. I wanted the ability to have tic labels formatted with commas. Rather then writing my own, I use the ability to call java from matlab.


ans =

To utilize with plotting:


This works as is for my needs, but I welcome any suggestions for improvement.

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
12 Mar 2014 Kenny

Kenny (view profile)

nice work

03 Mar 2014 Meng

Meng (view profile)

15 Apr 2013 Matlab2010


24 May 2012 K E

K E (view profile)

Simple but useful, for example to implement a thousands comma separator.

04 Apr 2007 Stephen Lienhard

Here are some examples of the syntax:

Comment only
09 Oct 2006 A User

Works just fine for me.

06 Oct 2006 Matlab User

does not solve the problem...

Contact us