www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/LinearInterpolationUsingInterp1qExample.m

    %% Linear Interpolation Using |interp1q|
% Generate a coarse sine curve and interpolate over a finer abscissa. 

% Copyright 2015 The MathWorks, Inc.

x = (0:10)'; 
y = sin(x); 
xi = (0:.25:10)'; 
yi = interp1q(x,y,xi); 
plot(x,y,'o',xi,yi)