home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 4.ddi / OPTIM.DI$ / QUADI.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  775 b   |  19 lines

  1. function [stepmin]=quadinter(steps,matf)
  2. %QUADINTER Quadraticly interpolates three points to estimate minimum.
  3. %         This function uses QUADRATIC interpolation and
  4. %         the values of three unevenly spaced points 
  5. %         in order estimate the minimum of a 
  6. %         a function along a line.
  7. %    syntax: [stepmin]=quadinter(steps,matf)
  8. %    where steps is a matrix constraining the spacing of the points.
  9. %          matf is a vector which contains the corresponding elements of f 
  10. %          stepmin is the step to the minimum.
  11.  
  12. %    Copyright (c) 1990 by the MathWorks, Inc.
  13. %    Andy Grace 7-9-90.
  14. steps=steps(:);
  15. % Solve simultaneous equations:
  16.       amat=[0.5*steps.*steps, steps, ones(3,1)];
  17.       abc=amat\matf(:);
  18.       stepmin=-abc(2)/abc(1);
  19.