How to assign values to a sparse matrix without iterations?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi, All,
I want to assign non-zero values to a matrix H. I know the locations of all the non-zeros. For example, I know the non-zero locations:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197449/image.png)
It indicates H(1,1)=1;H(1,2)=1;H(2,1)=1;H(2,5)=1;H(3,2)=1;H(3,3)=1;...
Would you please tell me how I can quickly assign this values without iterations?
Thanks a lot. Bei
댓글 수: 0
채택된 답변
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!