Create a table with 2 header lines followed by numeric data
Show older comments
header line 1 = string
header line 2 = string
line 3:end = numeric data
How do I create a table with two header lines followed by the numeric data?
I have been using table(numeric data, 'VariableNames', header line 1) but cannot find a way to have two header lines before the numeric data begins.
Any help would be much appreciated.
Accepted Answer
More Answers (1)
Hi Phil,
As mentioned in the documentation link, Tables store columns of data in variables. As you can see in the below mentioned example, the "patients" table stores data of many variables like "LastName", which is a header in the table too.
Having 2 headers is like storing 2 vairables in a single table column. Can you please explain your use-case?
If you just want to highlight the first row of data, you may try something like this -
LastName = ["<strong>Sanchez</strong>";"Johnson";"Zhang";"Diaz";"Brown"];
Age = ["<strong>38</strong>";43;38;40;49];
Smoker = ["<strong>true</strong>";false;true;false;true];
Height = ["<strong>71</strong>";69;64;67;64];
Weight = ["<strong>176</strong>";163;131;133;119];
BloodPressure = ["<strong>124</strong>" "<strong>93</strong>"; 109 77; 125 83; 117 75; 122 80];
patients = table(LastName,Age,Smoker,Height,Weight,BloodPressure)
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!