How to extract rows based on a particular column values in a matrix?
Mostrar comentarios más antiguos
I have attached a .mat file. It has two columns. In the second column if the values are greater than equal to 1 or if the values are less than equal to -1 the code will take the complete row and I'll get a new matrix. How to do it
Respuesta aceptada
Más respuestas (1)
KSSV
el 9 de Nov. de 2020
load D.mat ;
A = D(D(:,2)>=1,:) ;
B = D(D(:,2)<=-1,:) ;
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!