title: Up-/Downsampling of a logical vector (not with zeros)
body: <p>I hope you can help with a little problem I am having.
  I want to upsample and downsample a vector with zeros and ones. We have the functions upsample and downsample for that, however, the upsample function in Matlab only adds zeros to the vector. I would like to repeat the value, instead of just putting in zeros.</p>
  
  <p>Unfortunately the upsample function does not do that. Thus, I tried to use repmat (in the third dimension) and then reshape to get back to the old format. I know it must be possible with these functions, but if I simply use them, the vector just gets duplicated and added to the end.</p>
  
  <p>An example: 
  The input vector is: [1 0 0 1 0 1 0 1 1 1 0 0] (these should be random). </p>
  
  <p>Now I want to upsample (say) by a factor of 2. Then I want to get: 
  [1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 1 1 0 0 0 0].</p>
  
  <p>Thanks in advance for any help!</p>