0
$\begingroup$

Transpose[list,{n1,n2,...}]

What's the meaning of 'transpose list so that the k-th level in list us the n_k-th level in the result'?

As far as I'm concerned, I thought for a list of 4*4 matrix, the {n1,n2,...} can be {4,2,3,1} or {1,3,2,4} etc., but it was wrong, so what does the {n1,n2,...} mean?

$\endgroup$
9
  • 2
    $\begingroup$ You should read tperm which explains it explicitly with an example $\endgroup$
    – bmf
    Jan 12, 2023 at 11:02
  • 1
    $\begingroup$ Also, perhaps you could tell what kind of list you are trying to construct $\endgroup$
    – bmf
    Jan 12, 2023 at 11:05
  • 1
    $\begingroup$ ……Then why are you using this syntax of Transpose? Strongly related: mathematica.stackexchange.com/a/14810/1871 $\endgroup$
    – xzczd
    Jan 12, 2023 at 11:12
  • 1
    $\begingroup$ To understand this last question you should compare MatrixForm@Transpose[{{1, 2}, {3, 4}}] to MatrixForm@Transpose[{{1, 2}, {3, 4}}, {1}] as a minimal example $\endgroup$
    – bmf
    Jan 12, 2023 at 11:22
  • 1
    $\begingroup$ As mentioned in Details and Options section of document of Transpose: For a square matrix m, Transpose[m,{1,1}] returns the main diagonal of m, as given by Diagonal[m]. » $\endgroup$
    – xzczd
    Jan 12, 2023 at 11:31

0

Browse other questions tagged or ask your own question.