title: MATLAB: Duplicate each element of a vector?
body: <p>I'm new to MATLAB and this website as well. I tried searching for this question, but to no avail (so I apologize if this ends up being a questions which has already been asked here before). In class, we were assigned a problem with the following description: "For an n-dimensional vector X, the function should return another 2n-dimension where each element is repeated twice. For example: if a=[2 3 4 5], after using the function, a=[2 2 3 3 4 4 5 5];"
  It should work with a vector of ANY random size.</p>
  
  <p>Your help is really appreciated! 
  Thanks</p>