Eliminating the rows from a matrix

2 visualizaciones (últimos 30 días)
Karanvir singh Sohal
Karanvir singh Sohal el 23 de Mzo. de 2021
Comentada: Karanvir singh Sohal el 24 de Mzo. de 2021
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]

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 23 de Mzo. de 2021
index=A(:,end)<4;
A(index,:)=[]

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by