title: MATLAB Display real-time dates on x-axis
body: <p>I created a diagram presenting limb movement over the time (2.56 seconds). My diagram looks like in the top Picture 1. <img src="https://i.stack.imgur.com/gBLfo.jpg" alt="enter image description here"></p>
  
  <p>My code to get the diagram was:</p>
  
  <pre><code>x=data(1000:1256,2)
  Fs=100      
  Ts=1/Fs         
  L=length(x)  
  t = (0:L-1)*Ts;  
  figure      
  plot(t,x);
  </code></pre>
  
  <p>Now Im trying to change time units into real time data (day and time, when the measurements were recorded), I want to get something like in the Picture 2: mark x-axis with date and time. Ideally Id like to have 6 time marks.</p>
  
  <p>Using:</p>
  
  <pre><code>datestr(data(1000),'dd-mm-yyyy HH:MM:SS AM')
  </code></pre>
  
  <p>I know the first time (row 1000th of my data) is 10-07-2010 11:31:50 PM and the last row (1256th) is 10-07-2010 11:43:42 PM. There was always 50 records recorded per 1 second, BUT the problem is, the measurements were not recorded constantly - I mean, sometimes there was no measurements for a few minutes (when there was no movement).</p>
  
  <p>I ve been trying to use XTick etc but I dont know how to select the real-time data for my x-axis and how to label x-axis with the real time of measurements.</p>
  
  <pre><code>labels=datestr(data);
  set(gca,'XTick',1:6; 'XTickLabel',labels);
  </code></pre>
  
  <p>Anybody could help me?</p>