Aligning Columns of a Table

I'm tying to generate a table with 3 columns: Iterations,Bisection Method,False Position.
I've generated the table using:
table(Iterations,Bisection,False_Position)
but it comes out looking like this:
Iterations Bisection False_Position
__________ _________ ______________
1 0 -0.5
2 -0.5 -0.65957
3 -0.75 -0.71995
4 -0.875 -0.74228
5 -0.8125 -0.75036
6 -0.78125 -0.75326
7 -0.76563 -0.7543
8 -0.75781 -0.75467
9 -0.75391 -0.7548
10 -0.75586 -0.75485
I want the columns centred under the headings.
Any help would be GREATLY appreciated!!
Thank you in advance!!

Answers (1)

Peter Perkins
Peter Perkins on 3 Oct 2016
Most likely that you need to use a fixed-width font in your command window. MATLAB's default is a fixed-width font, perhaps you changed it.

Categories

Asked:

on 28 Sep 2016

Answered:

on 3 Oct 2016

Community Treasure Hunt

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

Start Hunting!