Happy new year SO members!
My first post for the new year, hoping to get some luck! :D
I have a 4D matrix X whose size is 100, 100, 100, 3. I extract its submatrix with X(51,:,51,:) and expect the result to be a 100x3 2D matrix. But NO, the result is a 4D matrix with size=1, 100, 1, 3. How come??
An even more confusing result is:
I can use plot(X(51,:,51,i)) and plot(X(:,51,51,i)) with i=1, 2, 3 just fine
can't use plot(X(51,51,:,i)) with the same i
in short, MATLAB submatrix extraction won't result in a size reduced matrix? and the different sub-access behaves differently, namely, more careful with the last dimension?
Thank you!
Edit01:
For convenience, I'd show my test results with singleton and squeeze here:
use of squeeze: