title: how to create own simulink block ?
body: <p>Hi</p>
  
  <p>i would to create a simulink block which can do the following operation.</p>
  
  <p>1) subtract input value with standard value untill the error is less than .01.</p>
  
  <p>example </p>
  
  <pre><code>input value = 7,0005. 
  standard values = [1,2,3,4,5,6,7,8,9,10] or [1:n] the result would be 7.
  </code></pre>
  
  <p>i can do it in matlab but i don't know how to do it in simulink.</p>
  
  <p>In Matlab</p>
  
  <pre><code>a = 7,0005 % or any other input value
  b = [1:10] % standard value
  error = 1;
  index = 0;
  while error &lt; 0.01
        error = abs(a-b(index+1));
  end
  
  outputResult = b(index+1);
  </code></pre>
  
  <p>please help me .......</p>