Navigation

Operators and Keywords

Function List:

C++ API

: flip (x)
: flip (x, dim)

Flip array across dimension dim.

Return a copy of x flipped about the dimension dim. dim defaults to the first non-singleton dimension. For example:

flip ([1  2  3  4])
      ⇒  4  3  2  1

flip ([1; 2; 3; 4])
      ⇒  4
          3
          2
          1

flip ([1 2; 3 4])
      ⇒  3  4
          1  2

flip ([1 2; 3 4], 2)
      ⇒  2  1
          4  3

See also: fliplr, flipud, rot90, rotdim, permute, transpose.

Package: octave