title: Circular Buffer in Simulink
body: <p>I would like to implement a very huge (10^6 Elements - fixed size) circular buffer in pure Simulink model (no further toolboxes, <strong>no S-Function</strong>). </p>
  
  <p>At some points I need to read some elements (anywhere, not just begin or end).</p>
  
  <p>The following solutions I can not use:</p>
  
  <ol>
  <li>"Queue Block" or "Buffer Block"  (I have no Signal Processing Toolbox available)</li>
  <li>"Discrete Delay" ( I need a hugh buffer and will not place 10^6 delays into the model)</li>
  <li>"Sim Events" (I need to <strong>generate code</strong> from this model)</li>
  </ol>
  
  <p>The "S-Function" I tried not yet, and I am looking for an alternative solution.</p>
  
  <p>What further approach do you know?</p>