title: MATLAB and Raster Plots
body: <p>I've looked through all raster related things on stackoverflow for Matlab and have not been able to find a useful and easy way for making a raster plot of some data. </p>
  
  <p>The raster plot I want to make uses the following vector:</p>
  
  <pre><code>X =[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;]
  </code></pre>
  
  <p>in this vector, a 0 = no response and a 1= a response. Each element also represents 0.1s. I want to make a plot that represents the data as a raster in the following way:</p>
  
  <p>| ||| | | | |||||| | | |</p>
  
  <p>---> Time
  (note: this example does not correspond to the data I have given) </p>
  
  <p>where Time is on the X-Axis and each line corresponds to a 1 (i.e. a response). Does anyone have some suggestions on how to do this? </p>
  
  <p>I did use Matlab's command for a sparsity plot, but it is not quite what I am looking for. Also, I tried linalg::raster but I do not have the toolbox this command requires.  </p>