Select repeating elements in an matrix

조회 수: 1 (최근 30일)
Maria Jesús Pérez Saiz
Maria Jesús Pérez Saiz 2021년 6월 3일
댓글: Sulaymon Eshkabilov 2021년 6월 3일
I have this matrix:
1 44
1 24
2 56
1 26
2 51
2 56
I want to select all rows whose first column is a one.
That is, I want to get an array:
1 44
1 24
1 26
and on the other hand:
2 56
2 51
2 56
Thank you very much for the help

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 3일
A = [???] % Your data
B = A(A(:,1)==1, :)
Good luck
  댓글 수: 2
Maria Jesús Pérez Saiz
Maria Jesús Pérez Saiz 2021년 6월 3일
Thank you very much for the help
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 3일
Most Welcome! It is just a pleasure to help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by