The squeeze
function in MATLAB removes dimensions of length 1 from an array.
Syntax:
main.m15 chars2 lines
Example:
main.m43 chars4 lines
Output:
main.m15 chars3 lines
In the above example, A is a 4D array with dimensions of size 2, 1, 3, 1. The squeeze function removes dimensions of length 1, so the resulting array B is a 2D array with dimensions of size 2 and 3.
gistlibby LogSnag