How to extract rows based on a particular column values in a matrix?
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Joydeb Saha
le 9 Nov 2020
Réponse apportée : Subhadeep Koley
le 9 Nov 2020
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
0 commentaires
Réponse acceptée
Subhadeep Koley
le 9 Nov 2020
load 'D.mat';
D_new = D((D(:, 2) >= 1) | (D(:, 2) <= -1), :);
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!