MATLAB: Array and Matrix question

array matrix

How would I go about creating a 4×3 array/matrix and use some of its values to create another array/matrix that is 2×2? I have to use 'x=y(a:b:c,d:e:f)', where y is my initial 4×3 and x would be my 2×2, in order to create my second array. I keep getting 'Index exceeds matrix dimensions.' No matter what I try. This is what my code looks like:
y=[1 2 4;3 2 -1;2 4 5; -2 -1 10]
x=y(12:-8:4,10:-8:3)

Best Answer

Something like this, maybe? Note that you need to refer to nth row and nth column:
x=y(2:-1:1,3:-1:2)