How can i create a table

1 Ansicht (letzte 30 Tage)
Lily
Lily am 6 Mai 2015
For example:
a=2; b=6; c=;8 I would like to create a table like
Times Frequency Value
--------------------------------
2 6 8
  3 Kommentare
Lily
Lily am 6 Mai 2015
I like to display my three variables to the screen like this
Walter Roberson
Walter Roberson am 6 Mai 2015
Well that's what my code does.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 6 Mai 2015
Bearbeitet: Walter Roberson am 6 Mai 2015
fprintf('%-20s %-20s %-20s\n', 'Times', 'Frequency', 'Value');
fprintf('%s\n', repmat('-', 1, 20*3+2));
fprintf('%-20d %-20d %-20d\n', a, b, c);
Output is
Times Frequency Value
--------------------------------------------------------------
2 6 8

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by