Interpolation

 

·           Interpolation is the estimation of values between known data points.  This technique is used with a variety of experimental data as a way to predict how a system, measured at certain operating points, will behave in others (that were not directly measured). 

 

·           Interpolation is also commonly used in signal processing as a way of changing the effective sampling rate of an audio signal or digital image.  Note that digital zooming of an image involves interpolating pixel values between the measured pixel values in order to show a larger image (more pixels).  

 

·           Commands related to interpolation include:

1.      interp1

2.      interp2

3.      interpn

4.      interp

 

·           Try this

 

M=[10,100,200,300,400];

D=[0.009,0.128,0.1802,0.3012,0.3609];

plot(M,D, 'r*');

xlabel('Mass (kg) ');

ylabel('Displacement (m) ');

title('Experimental Spring Data');

hold on

 

untested_mass = 30;

predicted_displacement = interp1(M,D,untested_mass,'spline')

 

plot(untested_mass, predicted_displacement, 'bo');

 

              legend('Experimental Data', 'Interpolated Data')

hold off