[Beginner] How do you make a summary table?

4 Ansichten (letzte 30 Tage)
Michael Burton
Michael Burton am 16 Aug. 2018
Beantwortet: Steven Lord am 16 Aug. 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]).

Akzeptierte Antwort

Steven Lord
Steven Lord am 16 Aug. 2018
Try using groupsummary on your larger table with the data readings.

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by