title: How to call simulink model(.slx) from script
body: <p>I'm a super beginner in Simulink models and control systems.
  I have .slx Simulink model for drone dynamics system. 
  It takes in two inputs (roll cmd, pitch cmd) and outputs velocity x, velocity y, position x, and position y. </p>
  
  <p>From here, it seems like I can open the system by calling</p>
  
  <pre><code>open_system('myModel.slx', 'loadable');
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gt8p3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gt8p3.png" alt="simulink model"></a></p>
  
  <p>But how do I put inputs and get output values? 
  Is there a way I can do this in a gui?</p>
  
  <p>EDIT:
  Here is the full layout of my model:<a href="https://i.stack.imgur.com/UtBy3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UtBy3.png" alt="enter image description here"></a></p>
  
  <p>When I did </p>
  
  <pre><code>roll_CMD=10;
  pitch_CMD=20;
  </code></pre>
  
  <p>I got a warning saying:</p>
  
  <pre><code>Input port 1 of 'SimpleDroneDynamics/...' is not connected.
  </code></pre>
  
  <ol>
  <li>How do I feed inputs using port numbers?</li>
  <li><p>How do I get outputs with port numbers? I tried </p>
  
  <p>[vx, vy, px, py] = sim('SimpleDroneDynamics.slx');</p></li>
  </ol>
  
  <p>and got an error saying</p>
  
  <pre><code>Number of left-hand side argument doesn't match block diagram...
  </code></pre>
  
  <ol start="3">
  <li>Is there a way to continuously feed inputs at every time step? This being controller module, I think I'm supposed to feed in different values based on output position and velocity. </li>
  </ol>
  
  <p>EDIT2: 
  I'm using Matlab2017a</p>