Effacer les filtres
Effacer les filtres

Conditional equation X1=X(y==1) ?

2 vues (au cours des 30 derniers jours)
Safouane Chergui
Safouane Chergui le 13 Juil 2017
I have a matrix X and a column vector y. When I write something like X1=X(y==1), I only get the numbers from the first column of X. How to get numbers from all others columns when y==1 ?

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 13 Juil 2017
X1=X(y==1,:)

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing 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