summary
Prints a statistical summary of the variables of a table.
Category: Language Fundamentals > Data Types
Syntax
summary(T)
Shows the type and main statistics of every variable in T.
S = summary(T)
Returns the summary as a value instead of printing it.
Description
For each variable summary reports its size and class. Numeric variables also show the minimum, median and maximum; categorical ones show the count per category. It gives a quick overview of an unknown dataset before analysis.
Use height, width and varfun when you need individual numbers, not a report.
Input arguments
T- Table or timetable (also categorical arrays).
Output arguments
S- The summary, when an output is requested.
Example
Summary of a table
T = table([1;2;3], [4;5;9], 'VariableNames', {'a','b'});
summary(T)
Output
ans =
'Variables:
a: 3×1 double
Min: 1 Median: 2 Max: 3
b: 3×1 double
Min: 4 Median: 5 Max: 9
'
Notes
The report is returned as a block of text with the minimum, median and maximum of numeric variables; its layout is simpler than MATLAB's.