My program creates a matrix that the values of the cells in several rows are the same in the corresponding columns. I want to delete some of these rows in order to filter the matrix. To clarify, my matrix has the following form,
A=[ 1 2 3 4
1 2 3 5
1 2 3 6
1 2 3 7
5 6 7 8
5 6 7 9
5 6 7 10]
and I want to delete the rows that in the first, the second and the third column their values are the same and leave in the matrix the rows that in the forth row has the biggest value. The result should be the following matrix:
A=[ 1 2 3 7
5 6 7 10]
I know that when we delete rows in matrix with a condition we use something like the following: M(M(:,4)<=1.5,:)=[];
, which deletes all the rows in the matrix that in the fourth column have values less than 1.5
. But I don't know how to do something like I described