Eliminating the rows from a matrix

조회 수: 3 (최근 30일)
Karanvir singh Sohal
Karanvir singh Sohal 2021년 3월 23일
댓글: Karanvir singh Sohal 2021년 3월 24일
Hello,
I have a matrix of any size (say m*n),
A=[22 23 44 13 12 ... 4
33 21 33 42 42 ... 3
21 33 12 43 13 ... 1
................... 4]
I want to remove the rows whose last column has value less than 4.
Desired output is
A=[22 23 44 13 12 ... 4
................... 4]

채택된 답변

Fangjun Jiang
Fangjun Jiang 2021년 3월 23일
index=A(:,end)<4;
A(index,:)=[]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by