How to commonolize all models for same category to each tool
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have cell array data. For each Category, I want to make sure each model exists for each tool(by Category only):For "Category1", the unique Models (and Tool1,Tool2,Tool3) are: A,B,C. But Each tool does not have All A,B,C models. For instance, Tool1 does not have Model "C", then take the average of other tools data (only under same category) for this model.
Many thanks in advance
ToolID Category Model Rank Temp pre Date count
Tool1 Category1 A 49.8 23 101 2018/2/6 1
Tool1 Category1 B 47.8 13 670 2018/2/6 4
Tool2 Category1 C 47.8 13 670 2018/2/6 12
Tool2 Category1 A 47.8 13 670 2018/2/6 12
Tool3 Category1 C 47.8 13 670 2018/2/6 12
Tool4 Category2 D 47.8 13 670 2018/2/6 34
Tool6 Category2 E 47.8 13 670 2018/2/6 34
Desired Output:
ToolID Category Model Rank Temp pre Date count
Tool1 Category1 A 49.8 23 101 2018/2/6 1
Tool1 Category1 B 47.8 13 670 2018/2/6 4
Tool2 Category1 C 47.8 13 670 2018/2/6 12
Tool2 Category1 A 47.8 13 670 2018/2/6 12
Tool3 Category1 C 47.8 13 670 2018/2/6 12
Tool4 Category2 D 47.8 13 670 2018/2/6 34
Tool6 Category2 E 47.8 13 670 2018/2/6 34
Tool1 Category1 C 47.8 13 670 2018/2/6 1
Tool2 Category1 B 47.8 13 670 2018/2/6 1
Tool3 Category1 A 47.8 13 670 2018/2/6 1
Tool3 Category1 B 47.8 13 670 2018/2/6 1
Tool4 Category2 E 47.8 13 670 2018/2/6 1
Tool6 Category2 D 47.8 13 670 2018/2/6 1
For example:
For Category1: Unique Models are "A,B,C", but Tool1 do not have model "C", and Model "C" exists for "Tool2 &Tool3", and take average of these two tools (Column mean of Rank, Temp, Pre) and assign count is 1, date does not change.
2. Likewise, tool2 doesn't have model "B", so, take average of other two tools, but here Tool1 only have this)
3. Tool3 does not have Model"A", which Tool1 & Tool2 have, so take the average. The same thing needs to do for Category2.
1 commentaire
Réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!