Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Joseph
Joseph 2014 年 2 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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)

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 2 月 5 日
Use fprintf() instead of disp(). Use format elements that have width counts. For example,
fprintf('%14.2f %12.2f ...', table.');
  1 件のコメント
Joseph
Joseph 2014 年 2 月 5 日
Thanks for your help. new to Matlab. I'll try and figure that out.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by