Finding matrix column index based on certain conditions
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lucas Carvalho
el 30 de Jul. de 2017
Comentada: Lucas Carvalho
el 31 de Jul. de 2017
Hello guys,
I want to extract the column indexes of a matrix which contains necessarily one element equals to 1 and all the other equal to zero. Matrix example:
A =
1 1 1 0 0 0 0 1 0 0 0 0 0
0 -1 -1 -1 0 0 0 -1 1 0 0 0 0
0 0 0 1 0 -1 0 0 0 1 0 0 0
0 0 1 0 1 0 -1 0 0 0 1 0 0
0 0 0 0 0 1 1 0 0 0 0 1 0
0 1 0 0 -1 0 0 0 0 0 0 0 1
The columns of this matrix which obey these conditions are: 1,9,10,11,12 and 13.
How can I implement these rules into my code??
Thank you very much indeed!
0 comentarios
Respuesta aceptada
Más respuestas (1)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!