Home Manual Packages Global Index Keywords Quick Reference Language Reference Function Reference Including Source Files Comments Issuing Shell Commands Matrix Multiplication Information About Variables Elementary Functions Advanced Array Indexing Index Range Functions Logical Functions Interpolation and Lookup Functions Sorting Transposing Manipulating Strings Generating Simple Meshes Using Pointers Instancing Data Structures Reshaping Arrays I/O Reference | # Yorick Function Reference ## Transposing `transpose(x)` transpose the 2-D array x `transpose(x, permutation)` general transpose The permutation is a comma delimited list of cyclic permutations to be applied to the indices of x. Each cyclic permutation may be: a list of dimension numbers [n1,n2,...,nN] to move dimension number n1 (the first dimension is number 1, the second number 2, and so on) to dimension number n2 , n2 to n3, and so on, until finally nN is moved to n1 . a scalar integer n to move dimension number 1 to dimension number n, 2 to n+1, and so on, cyclically permuting all of the indices of x. In either case, n or nI can be non-positive to refer to indices relative to the final dimension of x. That is, 0 refers to the final dimension of x, -1 to the next to last dimension, and so on. Thus, `transpose(x, [1,0])` swaps the first and last dimensions of x.