Extract a subarray from an array by eliminating certain rows and columns

Check out this stack-overflow post: