Find repeating line in matrix

1 view (last 30 days)
Buket Sahin
Buket Sahin on 4 Dec 2021
Commented: Buket Sahin on 4 Dec 2021
1 759.500000000000
2 779.500000000000
3 779.500000000000
4 779.500000000000
5 958.167000000000
6 958.167000000000
7 958.167000000000
8 958.167000000000
9 958.167000000000
10 1048.10000000000
11 1048.10000000000
Here is my sample matrix. For example, the value 779.500 repeated 4 times, while the value 958.1670 repeated 5 times. I want to find the first consecutive repeating value in the 2nd column of the matrix and transfer it to a new matrix as a row. After transferring, it should be seen as following;
1 759.500000000000
5 958.167000000000
10 1048.10000000000
Could you help me how can I do this?

Accepted Answer

Matt J
Matt J on 4 Dec 2021
Edited: Matt J on 4 Dec 2021

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by