title: Invalid setting for parameter 'Gain'
body: <p>I am trying to create a simple controller, but keep receiving an error for the gain block stating that there is an undefined variable 'u'. I do not understand Simulink well and I am just trying to replicate an old homework problem right now. The code I have here was provided as a solution, but I still receive the error when I try to run it. Any insights as to what might be going on?</p>
  
  <pre><code>I= 10; Wl= 5; k= 2; J= 1; 
  %set initial conditions
  thetaIC= 0; phiIC= 0; x0= zeros(4,1); 
  %fix theta= 0, check output
  [xe, ue]= trim('Ex3_System',x0,0,x0,1)  
  [A,B,~,~]= linmod('Ex3_System', xe, ue) 
  %choose your desired poles 
  p= linspace(-1.2,-1.5,4) 
  %recall the minus sign
  K= -acker(A,B,p) 
  %perturb initial condition 
  thetaIC= deg2rad(5); 
  sim('Ex3_Controller');
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ge5B5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ge5B5.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/IwpN9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IwpN9.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Invalid setting in 'Ex3_Controller/Gain' for parameter 'Gain'. Caused
    by:
        Error using hw12 (line 57)
        Error evaluating parameter 'Gain' in 'Ex3_Controller/Gain'
            Error using hw12 (line 57)
            Undefined function or variable 'u'.
                Error using hw12 (line 57)
                Variable 'u' does not exist.
                Suggested Actions:
                    • Load a file into 'Base Workspace'. - Fix
                    • Create a new variable. - Fix</p>
  </blockquote>
  
  <p>Update: After removing the <code>u</code> term from the <code>gain</code> block, I received a different error: </p>
  
  <blockquote>
    <p>Error using hw12 (line 57)
        Error in port widths or dimensions. Output port 1 of 'Ex3_Controller/Gain' is a one dimensional vector with 4 elements.
        Error using hw12 (line 57)
        Error in port widths or dimensions. Input port 1 of 'Ex3_Controller/Model1' is a one dimensional vector with 1 elements.</p>
  </blockquote>