MATLAB: How to construct this matrix without loop

MATLABmatrixvector

Hi, everyone:
suppose I have a vector x=[a b c d e f g h … z]. Is it possible to construct a matrix such that:
X=[a b c d; b c d e; c d e f; d e f g; e f g h; … w x y z];
without for-loop?
many thanks

Best Answer

X = x(bsxfun(@plus,(0:22).',(1:4)))