Set all elements of a sparse matrix to zero

1 次查看(过去 30 天)
I have 4 sparse matrices A, B, C, and D .
ABCD = [A B; C D];
How can I set the all elements of the sparse matrix B and C to zeros?
  3 个评论
James Tursa
James Tursa 2020-9-17
Do you mean you have ABCD and want to 0 out the parts originally associated with the B and C spots? Or do you mean you have A and D and want to built ABCD with effectively 0 for the B and C spots?
Bruno Luong
Bruno Luong 2020-9-17
编辑:Bruno Luong 2020-9-17
Strictly speaking, your question is trivial to answer!
B(:) = 0;
C(:) = 0;
I challenge you to tell me why this doesn't answer your question.
Just to show how your question is in fact ill-formulated.

请先登录,再进行评论。

采纳的回答

Bruno Luong
Bruno Luong 2020-9-18
B(:) = 0;
C(:) = 0;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by