function y=interp2d(xi1,xi2,Y) % ************************************************************ % y=interp2d(xi1,xi2,Y) % ************************************************************ % Interpolate values at (xi1,xi2) within the 10 by 5 matrix Y % ************************************************************ % Set up x1 grid % ---------------- x1=[0.002,0.005,0.01,0.02,0.05,0.1,0.2,0.5,1.0,2.0]'; % Set up x2 grid % ---------------- x2=[0.0,0.25,0.50,0.75,1.0]'; % Interpolate % ---------------- [n1,nn1]=size(xi1); for j=1:5 y1(:,j)=spline(log10(x1),Y(:,j),log10(xi1)); end for i=1:n1 yy(:,i)=spline(x2,y1(i,:)',xi2); end y=yy';