extract non-zeros block from matrice
1 次查看(过去 30 天)
显示 更早的评论
I have a matrix that contains several non-zeros blocks.The rest of the elements are zero. I want to put each of these blocks in a separate matrix. how can i do it?
0 个评论
回答(1 个)
jonas
2018-2-26
Not sure exactly what you want to do. The following creates a vector B containing all non-zeros of A
B=A(A~=0)
Do you want to extract several small matrices from a larger global matrix?
5 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!