Finding matrix column index based on certain conditions
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!