Jump to content

Matrix transposition: Difference between revisions

→‎{{header|J}}: use same example as other solutions
(→‎{{header|J}}: use same example as other solutions)
Line 438:
=={{header|J}}==
'''Solution:'''<br>
Transpose is the monadicprimitive primarymonadic verb <code>|:</code>
 
'''Example:'''
<lang j> ]matrix=: 10(^/ +}:) >:i.5 3 5 NB. make and show example matrix
101 11 121 13 14 1 1
152 16 174 18 19 8 16
203 21 229 23 2427 81
4 16 64 256
 
5 25 125 625
|: matrix
1 2 3 4 5
10 15 20
111 4 9 16 21 25
1 8 27 64 125
12 17 22
1 16 81 256 625</lang>
13 18 23
14 19 24</lang>
 
=={{header|Java}}==
892

edits

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