How to filter and regroup data in tables (unstack function)?
Show older comments
Hello, I am quite new user of Matlab and searched for solution for my problem, but without success. I have table with 2 variables (different reoccurring Elements, element State). There are 72 different elements with 2929 occurrences. (2929x2 table) Example:

I want to regroup my tall table to wide table with unique element numbers as row group and all element states as variables. Example:

I have tried unstack function, which does the grouping/conversion, but variables (states) will be as sum or mean of different states not different values. (I got 1x72 table, but it should be 200x72table) I also tried filtering out unique results of elements and joining tables, but problem was that number of states differ within elements (one Element has 200 different States, but other only 2).
I know this is simple issue, but I just don't have any idea.
Sander
1 Comment
Guillaume
on 12 May 2016
So what should the other 198 rows contain for that element that only has two states?
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!