Best way to display a group of arrays as a table?

19 views (last 30 days)
I have an assignment, and the output has to look like the one below. I have already finished all the code that will create the arrays and store the generated values into them, now all I need to do is put them in a table similar to the picture. Does anyone know what the easiest way to go about doing this would be? In a way that lets me display it like it does below while also being able to choose what the headers on the top row are because the name of my arrays are not the same as what is displayed on the top row. Thanks for the help!

Answers (1)

per isakson
per isakson on 17 Feb 2016
Edited: per isakson on 17 Feb 2016
"put them in a table " &nbsp on screen or to a text file?
If this format is good enough
T =
Gender Age State Vote
______ ___ _____ _____
M 45 'NY' true
F 32 'CA' false
M 34 'MA' false
then the easiest way is to use table, Create table from workspace variables
If not fprintf( 1, ... ) fprintf, Write data to text file

Categories

Find more on Tables in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!