W = width(T)
| Parameter | Description |
|---|---|
| T | Input array (table or other). |
| Parameter | Description |
|---|---|
| W | a integer value: Number of Variables in Table or size(T, 2). |
W = width(T) returns the number of variables in the table T.
The function width(T) is equivalent to size(T, 2), which also provides the number of columns in the table.
T = table();
width(T)
C = {'John', 28, true; 'Alice', 35, false; 'Bob', 42, true};
T = cell2table(C);
width(T)
| Version | Description |
|---|---|
| 1.8.0 | initial version |