Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I cant get my column headings to line up with corresponding data. here is my code...

1 vue (au cours des 30 derniers jours)
Joseph
Joseph le 5 Fév 2014
Clôturé : MATLAB Answer Bot le 20 Août 2021
They are two word headings and if it was possible to wrap text it might help...any ideas?
table=[M' Iy' MP' TP' TI'];
disp('')
disp( 'Months Annual Interest(%) Monthly Payment($) Total Payment($) Total Interest($)')
disp(table)

Réponses (1)

Walter Roberson
Walter Roberson le 5 Fév 2014
Use fprintf() instead of disp(). Use format elements that have width counts. For example,
fprintf('%14.2f %12.2f ...', table.');
  1 commentaire
Joseph
Joseph le 5 Fév 2014
Thanks for your help. new to Matlab. I'll try and figure that out.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by