transpose
Functions
-
int main(int argc, char *argv[])
transpose [ option ] [ infile ]
-r int
number of rows \((1 \le M)\)
-c int
number of columns \((1 \le N)\)
infile str
double-type data sequence
stdout
double-type transposed data sequence
The input of this command is
\[\begin{split} \begin{array}{cccc} x(0,0) & x(0,1) & \cdots & x(0,N-1) \\ x(1,0) & x(1,1) & \cdots & x(1,N-1) \\ \vdots & \vdots & & \vdots \\ x(M-1,0) & x(M-1,1) & \cdots & x(M-1,N-1) \end{array} \end{split}\]and the output is\[\begin{split} \begin{array}{cccc} x(0,0) & x(1,0) & \cdots & x(M-1,0) \\ x(0,1) & x(1,1) & \cdots & x(M-1,1) \\ \vdots & \vdots & & \vdots \\ x(0,N-1) & x(1,N-1) & \cdots & x(M-1,N-1) \end{array} \end{split}\]where \(M\) is the number of rows and \(N\) is the number of columns. Note that \(x(m,n) \, \forall m \ge M\) are discarded.# 0 1 2 # 3 4 5 ramp -l 10 | transpose -r 2 -c 3 | x2x +da -c 2 # 0 3 # 1 4 # 2 5
- Parameters:
argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
0 on success, 1 on failure.
See also