title: Forcing bus creator to only accept signals from a bus object
body: <p>This is Matlab/Simulink R2007a.</p>
  
  <p>I have created a bus named "FOOBUS" in the bus editor, which contains three elements, say "FOO1,FOO2,FOO3". </p>
  
  <p>The input port of a given subsystem is forced to accept -only- "FOO" type buses. This subsystem is saved in a library, along with a MAT file where the "FOO" Simulink.Bus object is defined. </p>
  
  <p>Now, when it comes to integrating the subsystem with other blocks:</p>
  
  <p>-How can I force a Bus Creator to show me the elements that comprise FOO? The thing is, that when building the FOO bus object (normally composing it using a Bus Creator configured to output a FOO bus object) I can't see the signals that should comprise the FOO bus object, and have to dive in the subsystem (or in the bus editor) to see which elements it has, and hand-write them at the Bus Creator dialog.</p>
  
  <p>-Any other proposal? The aim is to have clear interface definitions that can be invoked quite simply, and not re-writing them by hand in Bus Creator blocks. </p>
  
  <p>Thank you.</p>
  
  <p><strong>Added</strong></p>
  
  <p>Just to clarify, what I am mainly seeking is to create the Subsystem input bus without having to manually add the items (as the Bus Creator suggests AFAIK).</p>
  
  <p><strong>Answer for R2007a</strong>
  @MohsenNosratinia provided the basis for the answer (the original answer would not work in R2007A as looks like <em>arrayfun</em> does not accept BusElements. I used the plain array approach as a workaround.</p>
  
  <pre><code>function addSignalsToBusCreator(busDef)
  busEls = busDef.Elements;
  sigString = ' ';
  for i = 1 : length(busEls)
      sigString = [sigString busDef.Elements(i).Name ','];
  end
  set_param(gcb, 'Inputs', sigString(1:end-1));
  end
  </code></pre>