MATLAB: How to create a 2×2 matrix

2x2arraymatrix

Hello ,
i want to create a 2×2 matrix like that :
, h is 2×500 matrix .
So , i have to create a 2×2 matrix that each cell contains 2×500 matrix
I tried to write:
M = [h(1,:) h(2,:) ; h(2,:) h(1,:)]
But that ends up with a 2×1000 matrix .
What should i do ?
*Note that h is a complex array
thank you.

Best Answer

Use curly brackets instead of square brackets.
M = {h(1,:) h(2,:); h(2,:) h(1,:)};