Effacer les filtres
Effacer les filtres

how to cut the matrix

1 vue (au cours des 30 derniers jours)
Quynh tran
Quynh tran le 11 Mai 2017
Commenté : Quynh tran le 11 Mai 2017
Dear all, I have a matrix like this:
[1 0.1
2 0.2
3 0.3
4 0.5
5 0.6
6 1.2
7 1.2
8 1.3]
I want to cut the matrix part which is less than 1.2
It means that the result is:
[1 0.1
2 0.2
3 0.3
4 0.5
5 0.6]
Could you help me to write code for this. Thanks.

Réponse acceptée

James Tursa
James Tursa le 11 Mai 2017
x = [1 0.1
2 0.2
3 0.3
4 0.5
5 0.6
6 1.2
7 1.2
8 1.3];
>> y = x(x(:,2)<1.2,:)
y =
1.0000 0.1000
2.0000 0.2000
3.0000 0.3000
4.0000 0.5000
5.0000 0.6000
  1 commentaire
Quynh tran
Quynh tran le 11 Mai 2017
Thank you so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays 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