size(vec(x,5)) == [1 1 1 1 numel(x)] == shiftdim(x(:),-4) ==
reshape(x,[1 1 1 1 numel(x)])
I'm not aware of a simple way to do this otherwise or generically
(e.g. in a wrapper function for ifft(x,n,dim) where a shift vector
should be applied along the desired dimension). vec() is an octave
extension that does not exist in Matlab, so compatibility is not an
issue. The primary benefit is improved semantics -- vec(x,10) is more
semantically direct than the reshape(...), shiftdim(...) constructs.
--judd