ifftshift
is an R equivalent to the Matlab function ifftshift
applied on matrices. For more information about ifftshift
see
the Matlab documentation.
ifftshift(inputMatrix, dimension = -1)
Swapped matrix.
Matrix to be swapped.
Which swap should be performed?
1
: swap halves along the rows.
2
: swap halves along the columns.
-1
: swap first quadrant with third and second quadrant with fourth.
ifftshift
is the inverse function to fftshift
. For more
information see the details of fftshift
set.seed(987)
sampleMat <- matrix(sample(1:10, size = 25, replace = TRUE), nrow = 5)
# Swap halves along the rows:
ifftshift(sampleMat, dimension = 1)
# Swap halves along the columns:
ifftshift(sampleMat, dimension = 2)
# Swap first quadrant with third and second quadrant with fourth:
ifftshift(sampleMat, dimension = -1)
Run the code above in your browser using DataLab