Info

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

sparse mtrix from sparse matrices

조회 수: 2 (최근 30일)
fatema saba
fatema saba 2014년 11월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi
I have three matrices (a, h and k1) like:
a =
(1,1) 1
(2,2) 1
(3,3) 1
(4,4) 1
(5,5) 1
(6,6) 1
(7,7) 1
(8,8) 1
(9,9) 1
>> h=sparse(n3,n3)
h =
All zero sparse: 9-by-9
>> k1=-4*a
k1 =
(1,1) -4
(2,2) -4
(3,3) -4
(4,4) -4
(5,5) -4
(6,6) -4
(7,7) -4
(8,8) -4
(9,9) -4
I want to create a matrix from these matrices in this form that is sparse.
q=['k1' 'h' 'a' 'h'; 'h' 'k1' 'h' 'a']
How can create that please?
  댓글 수: 2
fatema saba
fatema saba 2014년 11월 26일
Hi
I can find it. it is something like that:
q=sparse([k1,h,a,h;h,k1,h,a])
the cyclist
the cyclist 2014년 11월 26일
I think the concatenation of sparse arrays is sparse, so you probably don't need that sparse command.

답변 (0개)

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by