Jump to content

Kronecker product: Difference between revisions

+octave
(+octave)
Line 1,730:
 
 
 
=={{header|Octave}}==
<lang octave>>> kron([1 2; 3 4], [0 5; 6 7])
ans =
 
0 5 0 10
6 7 12 14
0 15 0 20
18 21 24 28
 
>> kron([0 1 0; 1 1 1; 0 1 0], [1 1 1 1; 1 0 0 1; 1 1 1 1])
ans =
 
0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 1 0 0 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 1 1 0 0 1 1 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 1 0 0 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0</lang>
 
=={{header|PARI/GP}}==
1,336

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.