How do I align decimal points in a table?

3 views (last 30 days)
Bharath Lohray
Bharath Lohray on 12 Jul 2017
Answered: Walter Roberson on 12 Jul 2017
Here is a sample of my data. I would like to align the decimal points to make it easy to read. How do I do this?
Entropy Min Max std
_______ _________ _______ ________
xyz_z 6.2908 0.0060019 0.83143 0.15786
xyz_y 6.2812 0.011033 0.81358 0.17433
xyz_x 6.1703 0.016483 0.76458 0.16028
RGB_B 5.6583 0 0.89412 0.13687
RGB_G 5.6379 0.062745 0.91373 0.15714
RGB_R 5.5792 0 0.94118 0.17313
Gray_WA 5.5706 0.086455 0.91075 0.15458
NTSC_Y 5.5706 0.086455 0.91075 0.15458
Gray_A 5.5398 0.11111 0.8902 0.14837
HSV_V 5.5371 0.21961 0.94118 0.11085
YCbCr_Y 5.3517 0.13699 0.84492 0.13275
HSV_S 5.0647 0 1 0.17222
HSV_H 4.6601 0 0.99858 0.10478
NTSC_I 3.5758 -0.2332 0.37468 0.053372
YCbCr_Cr 3.2791 0.32766 0.74433 0.034347
YCbCr_Cb 3.2367 0.1561 0.7043 0.033095
NTSC_Q 0.55185 -0.20632 0.12336 0.023349

Answers (2)

Star Strider
Star Strider on 12 Jul 2017
Applying a particular format to a table does not appear to be an option. It does not even inherit the current format setting.

Walter Roberson
Walter Roberson on 12 Jul 2017
If that is a table() object then you will need to convert the entries to strings using whatever formatting rules you find appropriate, such as '%10.7f'
table() objects have no format controls.

Products

Community Treasure Hunt

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

Start Hunting!