Effacer les filtres
Effacer les filtres

matrix

1 vue (au cours des 30 derniers jours)
ricco
ricco le 20 Nov 2011
I have a matrix where the first column contains values of either 211, 212 or 213 where the rows starting with 211 contains the data and the other rows contain random numerals. How would I take only the rows which contained 211 in the first column and disregard the others. So, basically re-define the matrix to only contain the rows starting with 211?
cheers

Réponse acceptée

Jan
Jan le 20 Nov 2011
M = [211, 3,4,5,6; ...
212, 5,4,3,2; ...
213, 7,6,4,3; ...
211, 1,2,3,4];
index = (M(:, 1) == 211);
M2 = M(index, :);

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by