title: How to get a transfer function from a Simulink model into Matlab
body: <p>I would like to plot a transfer function from a Simulnik file model.mdl where I used blocks From Workspace (simin) and To Workspace (simou) to start a simulation from Matlab.</p>
  
  <p>And now comes the problem. I simply can't find a way to run this Simulink model in Matlab. </p>
  
  <p>Here is my code;</p>
  
  <pre><code>sim('model');  
  
  
  h=simout/simin;
  
  [H,omega]=freqz(h);
  %plot
  </code></pre>
  
  <p>I get this errors;</p>
  
  <pre><code>Error evaluating parameter 'VariableName' in 'model/From
  Workspace'
  
  Caused by:
      Error using sigma (line 8)
      Undefined function or variable 'simin'.
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>This is my model:
  <img src="https://i.stack.imgur.com/svs0K.jpg" alt="enter image description here"></p>
  
  <p>Thank you so much.</p>