title: how to input Matlab "Bus Objects" in to "Level-2 MATLAB S-Functions"
body: <p>is it possible to use bus datatypes for m-file s-function blocks in Simulink?</p>
  
  <p>I haven't found any examples for this in the matlab documentation or anywhere online.</p>
  
  <p>For s-Functions written in C the API looks somewhat like this</p>
  
  <pre><code>  DTypeId dataTypeIdReg;
    ssRegisterTypeFromNamedObject(S, "myBusObject", &amp;dataTypeIdReg);
    if(dataTypeIdReg == INVALID_DTYPE_ID) return;
    ssSetInputPortDataType(S,0, dataTypeIdReg);
  </code></pre>
  
  <p>now I'd like to access the same data type (a structure in C, a bus object in Matlab) from within my *.m source code.
  Do you know of any example or tutorial about this? As you might notice I'm not too familiar with the Simulink environment...</p>
  
  <p>I also found different information on whether this is even possible</p>
  
  <p>Q: do level 2 s-functions support bus objects?</p>
  
  <ul>
  <li>Answer 1 "yes, all data types are supported": <a href="http://nl.mathworks.com/help/simulink/sfg/s-function-features.html" rel="nofollow">http://nl.mathworks.com/help/simulink/sfg/s-function-features.html</a></li>
  <li>Answer 2 "no, bus objects are not supported": <a href="http://nl.mathworks.com/help/simulink/sfg/s-function-limitations.html" rel="nofollow">http://nl.mathworks.com/help/simulink/sfg/s-function-limitations.html</a></li>
  </ul>