title: Retrieve interpolated value from look up table
body: <p>I have a function in which a look up table is created. LUT has some random x points and corresponding Y values. Now I have another function which uses a loop to find exact X point say xq. In each loop I also need to find the corresponding Y value (yq) by <strong>passing only the current Xq</strong> to another function which should <strong>interpolate</strong> and obtain Yq value in case Xq value is not found in the LUT and is within limit. But I find that I have to pass the x and Y array used in LUT as well as current xq point each time in my loop if I use <strong>interp1</strong>. Is there any other means to get Yq value <strong>without passing the entire x and y arrays</strong>?
  I have given the structure of the code below. </p>
  
  <pre><code>func to create LUT
          x = [1.8558;2.5549;3.4438;4.433;5.5271;6.5236;7.4795;8.4345;9.232;9.8256;10.4205;10.9303;11.3257;11.8103];
          y = [0.0433;0.0598;0.0672;0.0749;0.0945;0.0991;0.0858;0.0857;0.0894;0.0788;0.0838;0.0815;0.0866;0.0971];
  
   main func
  
      for i = 1:1:1000
          expression for xq ;
          call func to find yq from LUT by passing only xq ;
          do something using xq and yq ;
      end
  </code></pre>
  
  <p>Thanks </p>