MATLAB Answers

How to convert a matrix to a table with headings

7 views (last 30 days)
Hello all, I am new to matlab and I have created this matrix from data by using various formulas and now i want to add heading to it. Can someone please guide me how to do this. It is a 7*9 matrix
X =
294.1560 230.5800 63.5760 2.0194 1.7763 -0.9084 -293.4180 -90.2551 266.7389
328.5000 230.5800 97.9200 2.1296 1.7763 -0.7982 -257.8234 -89.8860 265.8574
367.6640 230.5800 137.0840 2.2419 1.7763 -0.6859 -221.5505 -89.5398 269.0948
421.0700 230.5800 190.4900 2.3771 1.7763 -0.5507 -177.8809 -89.1509 279.2200
482.5700 230.5800 251.9900 2.5131 1.7763 -0.4147 -133.9529 -88.8135 297.1294
553.5940 230.5800 323.0140 2.6502 1.7763 -0.2776 -89.6696 -88.4916 324.1920
641.4000 230.5800 410.8200 2.7978 1.7763 -0.1300 -41.9948 -88.1127 364.7022

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 5 Aug 2020
T = array2table(X, 'VariableNames', {'Time', 'WindDirection', 'WindVelocity', 'Temperature', 'Precipitation', 'DewPoint', 'C7', 'C8', 'C9'});
Except you would use names that were relevant to your purposes.

  2 Comments

Niraj Pansara
Niraj Pansara on 5 Aug 2020
Thank you for answer the question
The solution worked fine.
But is there any way to display this table in command window when i run my code?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by