How do I make a table using fprintf?

12 Ansichten (letzte 30 Tage)
Laura
Laura am 16 Okt. 2014
Beantwortet: Star Strider am 16 Okt. 2014
I need to make a 13x2 table from data in Matlab with titles. I wasn't shown how to do this and I can't find help online.

Antworten (1)

Star Strider
Star Strider am 16 Okt. 2014
This is one way:
x = randi(10,13,2); % Create Data
fprintf(1, ' Col#1 Col#2\n') % Column Titles
fprintf(1, '\t\t%2d\t\t%2d\n', x') % Write Rows

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by