I have a vector A=[1 2 1 4; 5 3 5 7; 6 1 8 9], the first row represent age group, and the second row represents skill level, and the third row is the count of people. From A, I want to produce matrix B where is the compact form of A, in other words, if two or more columns represent the people in the same age and skill level group, we remove all of them and only keep one of them. For our example, A([1 2],1) = A([1 2],3) = [1;5], therefore B=[1 2 4; 5 3 7; 14 1 9].
MATLAB: How to summarize a matrix based on unique groups
functionhistogrammatlab functionvector
Related Question
- Removing rows that are not unique from an array
- Find rows of two matricies (of different sizes) based on matching element of one column
- How to remove duplicate rows in a matrix by considering the repeated values in a specific column
- Taking unique numbers of a set and order them with their respective number
Best Answer