title: Create a specific number pattern using matlab / octave
body: <p>How can I create a specific number pattern?  Where the last number starts the 2nd pattern section.</p>
  
  <p>Example:</p>
  
  <p><strong>I want to follow / repeat the pattern 1,5,4</strong></p>
  
  <pre><code>1st pattern in section 1,5,4
  2nd pattern in section 5,9,8
  3rd pattern in section 9,13,12
  
  final array would be = [1,5,4,5,9,8,9,13,12,...]
  </code></pre>
  
  <p><strong>note: this is just a simple example the pattern will be about 100,000 + numbers</strong></p>
  
  <p>I know about repmat and cumsum but combining these two didn't work </p>
  
  <p>PS:  I'm using Octave 4.2.2 which is similar to Matlab</p>