Set all elements of a sparse matrix to zero

2 vues (au cours des 30 derniers jours)
NA
NA le 17 Sep 2020
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 commentaires
James Tursa
James Tursa le 17 Sep 2020
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 le 17 Sep 2020
Modifié(e) : Bruno Luong le 17 Sep 2020
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.

Connectez-vous pour commenter.

Réponse acceptée

Bruno Luong
Bruno Luong le 18 Sep 2020
B(:) = 0;
C(:) = 0;

Plus de réponses (0)

Catégories

En savoir plus sur Sparse Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by