Matlab Desktop 2023a, tables have new feature that automatically displays summary statistics for each column in the table. How do I access and save stats from within matlab?

3 visualizaciones (últimos 30 días)
Hello I recently downloaded and installed the 2023a desktop version of matlab and its accompanying dark mode. I noticed while creating a table that useful summary statistics were provided in each column, such as calculating the max, min, and stdev.
In other cases it would calculate the numer of times a unique string showed up.
I'm wondering is there a way to directly acess this data and save it to a variable from within matlab? I've provided a picture of what I mean below (see the top of the table)

Respuestas (1)

Karanjot
Karanjot el 23 de Ag. de 2023
Editada: Karanjot el 23 de Ag. de 2023
Hi Michael,
It is my understanding that you want to store the summary of a table to a variable.
Suppose you have the following table:
patients=5×6 table
LastName Age Smoker Height Weight BloodPressure
"Sanchez" 38 true 71 176 124 93
"Johnson" 43 false 69 163 109 77
"Zhang" 38 true 64 131 125 83
"Diaz" 40 false 67 133 117 75
"Brown" 49 true 64 119 122 80
You can define a struct:
tableSummary = summary(patients)
You can access the stats of the table using the "tableSummary" variable.
For example, To get the minimum value in the "Age" column:
s.Age.Min
To learn more about table summary, you can refer to the below MathWorks documentation.
I hope this information helps!

Categorías

Más información sobre Downloads en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by