Set all elements of a sparse matrix to zero

조회 수: 1 (최근 30일)
NA
NA 2020년 9월 17일
답변: Bruno Luong 2020년 9월 18일
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