[Beginner] How do you make a summary table?

3 vues (au cours des 30 derniers jours)
Michael Burton
Michael Burton le 16 Août 2018
Sorry if this is a beginner question but I spent over an hour searching online and cannot find it. Maybe I don't know the right search terms but I genuinely tried and cannot find it.
I have a table of ~2.5 million sensor readings from ~100 sensors. I have made a second table with sensor IDs. I want to add rows to the table which spit out summary statistics. For example, I want to know how many times each sensor chirped. I can find that out by doing "height(Data(SensorID=='[Sensor Name]',:))" but when I put "MasterTable.NumOfReadings = height(Data(SensorID=MasterTable.SensorID,:))", I get an error saying the tables are not the same size (duh).
In short, I want to know: If I have tables T1 (A x 2+) and T2 (B x 1) in which T1 is the raw data T2 is the unique categorical values of T1 (and thus A>B), how do I add rows to T2 which perform operations on the data entries in T1 with matching categorical data of the values in T2?
If it helps, the forumla in excel would be =CountIf(Data[@SensorID],MasterTable[@sensorID]).

Réponse acceptée

Steven Lord
Steven Lord le 16 Août 2018
Try using groupsummary on your larger table with the data readings.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by