Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
Safouane Chergui
Safouane Chergui am 13 Jul. 2017
Beantwortet: Fangjun Jiang am 13 Jul. 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 ?

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 13 Jul. 2017
X1=X(y==1,:)

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by