Documentation Center

  • Trial Software
  • Product Updates

height

Number of table rows

Syntax

Description

example

H = height(T) returns the number of rows in the table, T.

height(T) is equivalent to size(T,1).

Examples

expand all

Number of Table Rows

Create a table, T.

LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];

T = table(Age,Height,Weight,BloodPressure,'RowNames',LastName)
T = 

                Age    Height    Weight     BloodPressure 
                ___    ______    ______    _______________

    Smith       38     71        176       124          93
    Johnson     43     69        163       109          77
    Williams    38     64        131       125          83
    Jones       40     67        133       117          75
    Brown       49     64        119       122          80

Find the number of rows in table T.

H = height(T)
H =

     5

T contains five rows; height does not count the variable names.

Input Arguments

expand all

T — Input tabletable

Input table, specified as a table.

See Also

| |

Was this topic helpful?