% Example 10-5: Interpolating temperature data t = [7 9 11 12]; Temp = [49 57 71 75]; plot(t, Temp, '-o') xlabel('Time') ylabel('Temperature (deg F)') grid hold on % Use interp1 to find the missing temperatures % with linear interpolation t_missing = [8,10]; interp1(t, Temp, t_missing) pause % Try cubic spline interpolation interp1(t, Temp, t_missing, 'spline') pause % Plot the splines t_spline = [7:0.01:12]; Temp_spline = interp1(t, Temp, t_spline, 'spline'); plot(t_spline, Temp_spline, 'r--') hold off