Effacer les filtres
Effacer les filtres

Extracting only certain data from a matrix

2 vues (au cours des 30 derniers jours)
Justin
Justin le 11 Juil 2023
Commenté : the cyclist le 11 Juil 2023
I have a very large matrix and I need only certain data to show from it. I need only the data that has values of 3 in the first column. How do I find this.
  1 commentaire
the cyclist
the cyclist le 11 Juil 2023
You might benefit from the free MATLAB Onramp tutorial.

Connectez-vous pour commenter.

Réponses (2)

Stephen23
Stephen23 le 11 Juil 2023
Where M is your matrix:
X = M(:,1)==3;
B = M(X,:)

Parth Saraf
Parth Saraf le 11 Juil 2023
Hi,
You can try using this:
M(M(:, 1) == 3)
Hope this helps!
  1 commentaire
the cyclist
the cyclist le 11 Juil 2023
I think this needs to be
M(M(:, 1) == 3,:)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical 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!

Translated by