I have a Nx4 cell array in Matlab which looks something like this:
id1 word11 word12 word13
....
id2 word21 word22 word32
....
idN wordN1 wordN2 wordN3
where each of the four columns holds a string and the second column (word11... wordN1) can have duplicate values. I want to get another cell array but with unique rows according to the second column. so in the previous example if word21 was the same as wordN1, the resulting array should have the following two rows only (doesn't matter which row of the duplicates gets chosen):
id1 word11 word12 word13
....
idN wordN1 wordN2 wordN3
I tried unique(cellArray{2}) but it only returns the second column with the unique values and I want the whole row. How can I do this?
Thanks