David
Farruggio

MathGenie

flip

Flip order of elements

Syntax and Description

flip(A) returns an array of the same size as A, but with the order of the elements reversed. The dimension that is reordered in that array depends on the shape of A:
  • If A is vector, then flip(A) reverses the order of the elements along the length of the vector.
  • If A is a matrix, then flip(A) reverses the elements in each column.
flip(A,dim) reverses the order of the elements in A along dimension dim. For example, if A is a matrix, then flip(A,1) reverses the elements in each column, and flip(A,2) reverses the elements in each row.

Back to functions