home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / POLYFUN.DI$ / TABLE2.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  557 b   |  19 lines

  1. function z = table2(tab,x0,y0)
  2. %TABLE2    Two-dimensional table look-up.
  3. %    Z = TABLE2(TAB,X0,Y0) returns a linearly interpolated
  4. %    intersection from table TAB, looking up X0 in the first
  5. %    column and Y0 in the first row of TAB.  
  6. %
  7. %    See also INTERP3, INTERP4, INTERP5, TABLE1.
  8.  
  9. %    Paul Travers 7-14-87
  10. %    Revised JNL 3-15-89
  11. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  12.  
  13. if (nargin ~= 3), error('Must be used with three input arguments.'), end
  14.  
  15. [m,n] = size(tab);
  16. a = table1(tab(2:m,:),x0);
  17. tab2 = [tab(1,2:n).' a.'];
  18. z = table1(tab2,y0).';
  19.