# NOT RUN {
set.seed(987)
sampleMat <- matrix(sample(1:10, size = 25, replace = TRUE), nrow = 5)
# Swap halves along the rows:
fftshift(sampleMat, dimension = 1)
# Swap halves along the columns:
fftshift(sampleMat, dimension = 2)
# Swap first quadrant with third and second quadrant with fourth:
fftshift(sampleMat, dimension = -1)
# }
Run the code above in your browser using DataLab