sparse mtrix from sparse matrices
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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 Comments
fatema saba
on 26 Nov 2014
the cyclist
on 26 Nov 2014
I think the concatenation of sparse arrays is sparse, so you probably don't need that sparse command.
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!