title: How to store arbitrary types in Simulink in block-scope?
body: <p>Apparently Simulink supports only few datatypes. </p>
  
  <p>So, how to keep something other? I want to produces images from a directory, how to keep directory list and current position?</p>
  
  <p>The following code causes error</p>
  
  <pre><code>function DoPostPropSetup(block)
  
    block.NumDworks = 1;
  
    block.Dwork(1).Name            = 'Filelist';
    block.Dwork(1).Dimensions      = 1;
    % block.Dwork(1).DatatypeID      = -10;      % MATLAB Array  % does not work
    block.Dwork(1).DatatypeID      = 0;      % double
    block.Dwork(1).Complexity      = 'Real'; % real
    block.Dwork(1).UsedAsDiscState = true;
  
    block.Dwork(1).Data = dir(block.DialogPrm(1).Data);
  </code></pre>