Effacer les filtres
Effacer les filtres

Selecting points from a matrix

7 vues (au cours des 30 derniers jours)
Jen
Jen le 18 Juin 2018
Commenté : Jen le 18 Juin 2018
I'm trying to select certain points from a very large matrix using Matlab that fall in a value range and make the rest of the values zeroed in that matrix. The matrix is about 500x500 and I only want values between 9 and 10 to show and everything else zeroed. Please let me know if this is possible/ if you can help? Thanks!

Réponse acceptée

Paolo
Paolo le 18 Juin 2018
x = [9,10,3,2,6;3,1,7,8,10];
x =
9 10 3 2 6
3 1 7 8 10
x(x<9 | x>10) = 0;
x =
9 10 0 0 0
0 0 0 0 10
  1 commentaire
Jen
Jen le 18 Juin 2018
Thank you, this worked!

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 18 Juin 2018
Modifié(e) : Matt J le 18 Juin 2018
If A is your matrix
A( A<9 | A>10)=0 ;
  1 commentaire
Jen
Jen le 18 Juin 2018
Thank you!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by