MATLAB: Does INTERP1 in MATLAB 6.5 (R13) give different result as compared to MATLAB 6.1(R12.1)

differentinfinterp1MATLABmatlab6.5result

Why does INTERP1 in MATLAB 6.5 (R13) give different result as compared to MATLAB 6.1(R12.1)?
If a set of data consists of INF as a point, then INTERP1 gives all zeros in MATLAB 6.5 (R13). The sample code below illustrates this point:
interp1([0 .99 1.01 2 inf],[0 0 1 1 1],.5:1:2.5)
The above results
ans =
0 0 0

Best Answer

This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This is a bug when using INF with the INTERP1 function in MATLAB 6.5 (R13). Our development team is currently investigating this issue.
As a workaround, please avoid using INF as a data point. Instead, you can use a large number, as large as REALMAX (typically of the order of 1.7977e+308). This will give results that are consistent with MATLAB 6.1 (R12.1).