Reputation: 1103
I have a 3 dimensional array. I want to assign only the first two dimensions to a 2D array.
The array is
A<44,512,3 uint8>
I need to drop the 3 and assign it to a new array B so that B would be
B<44,512 uint8>
I do not know how to proceed. Could someone please help me ?
Upvotes: 1
Views: 1275
Reputation: 74940
Which 2D slice of your 3D array do you need? If you want slice #2, you do:
B = A(:,:,2);
Upvotes: 1