Please enable JavaScript to view this site.

Knowledge Base

Flips (reverses the order of) a matrix along a given dimension.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

C = flip(A, dim);

Flips the matrix A along the dimension dim.

 

Example

Reverse the order of rows and columns of a 2x3 matrix.

?A=[1,2,3;4,5,6];

?B=flip(A,1); # flip (reverse) order of rows

?B=flip(A,2); # flip (reverse) order of columns 

 

result: 

1 2 3 

4 5 6 

result: 

4 5 6 

1 2 3 

result: 

3 2 1 

6 5 4 

 

See Also

Functions, size, length, pinch, transpose, reshape, permute

Copyright Lumerical Inc. | Privacy | Site Map