Why does INTERP1 in MATLAB 6.5 (R13) give different result as compared to MATLAB 6.1(R12.1)?

2 views (last 30 days)
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

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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).

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!