필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to set unlabeled values in matrix to zero

조회 수: 1 (최근 30일)
Mel
Mel 2020년 8월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello everyone!
I have a 1536 x 2048 matrix. For visualization purposes I preprocessed 1Mio random data points and labeled them. Now I want to plot the previous matrix, but set the values of the other 2 Mio data points to zero in order to make the processed ones visible. Is this even possible? I'd be super grateful if you guys could help.
Thank you in advance
  댓글 수: 2
Rik
Rik 2020년 8월 26일
Is this possible? Probably. If you want help you will either have to provide instructions on how to hack your computer or explain what you did.
Have a read here and here. It will greatly improve your chances of getting an answer.
Rafael Hernandez-Walls
Rafael Hernandez-Walls 2020년 8월 26일
spy(S)
plots the sparsity pattern of matrix S. Nonzero values are colored while zero values are white

답변 (1개)

Rishabh Mishra
Rishabh Mishra 2020년 9월 3일
Assuming the name of the matrix variable as 'mat'
To set unlabeled matrix values to 0, consider the pseudocode below:
for i = 1:1536
for j = 1:2048
If mat(i)(j) is unlabeled
Set mat(i)(j) to 0
end
end
To visualize sparsity pattern of the matrix, use the code below.
>> spy(mat)
For more information on ‘spy()’ function, refer this link.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by