Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Safouane Chergui
Safouane Chergui el 13 de Jul. de 2017
Respondida: Fangjun Jiang el 13 de Jul. de 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 ?

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by