interp1 insufficiently documented
Reported by Federico Miyara
BUG DESCRIPTION:
----------------
In the Arguments section it states, for extrapolation,
extrapolation
(optional) string, or real value defining the yp(j) components for xp(j) values outside [x1,xn] interval.
In the Description section the only string listed is "extrap" which says:
"extrap"
the extrapolation is performed by the defined method
If one selects the method "spline" it is suggested to refer to interp(), which has a specific argument (called out_mode) with several possibilities for extrapolation. These possibilities aren't accessible from the interp1() function, so it should be completely clear in its documantation which one is used.
Besides, the argument extrapolation is optional but it is not clear what happens if it is not used. Purportedly, it is what appears under "by default", but again it says
by default
the extrapolation is performed by the defined method (for spline method)
But, as already mentioned, the spline method has more than one extrapolation strategy, which can be selected for interp() but not from interp1().
By the way, interp() also lacks information regarding the default behavior if the optional argument out_mode is not used, but in that case at least the user can provide the argument and be sure how the function will behave. This is not the case for interp1().
Finally, at least for spline it seems to be no difference between setting the extrapolation argument to "extrap" or not using it.
ERROR LOG:
----------
N/A
HOW TO REPRODUCE THE BUG:
-------------------------
help interp1
OTHER INFORMATION:
------------------
Suggestions:
1) Include information as to how exactly will be the extrapolation carried out
2) Or better, let the argument extrapolation accept the same values as in interp.
3) In case 2) make it also clear which is the default behavior for interp
4) Consider unifying the designations "extrapolation" and "out_mode" across the different functions