Remove singleton dimensions from x and return the result. Note that for compatibility with Matlab, all objects have a minimum of two dimensions and row vectors are left unchanged.