[Beginner] How do you make a summary table?

4 ビュー (過去 30 日間)
Michael Burton
Michael Burton 2018 年 8 月 16 日
回答済み: Steven Lord 2018 年 8 月 16 日
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]).

採用された回答

Steven Lord
Steven Lord 2018 年 8 月 16 日
Try using groupsummary on your larger table with the data readings.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by