05-09-2019 02:10 AM
Hello,
I'm trying to use Matlab script in my app. I'm using interp1(x,v,xq,method,extrapolation) Matlab function in it.
If I use MathScript Node, it returns an error "You specified an invalid number of input parameters for this function."
LabVIEW help is saying that interp1 do not have extrapolation argument and also that it is only possible to use cubic, linear, nearest or spline as method value.
I understand that basically MathScript and Matlab is not the same but if documentation is saying that Matlab interp1 equivalent for MathScript is interpolate1d (officially interpolate1d but interp1 is also working) then it is covering all the original functionality or only some parts? If the latter is true, how to find the differences?
Matlab help is saying that interp1 can have linear, nearest, next, previous, pchip, cubic, v5cubic, makima or spline as method value.
I checked all of them and it turns out that pchip and v5cubic are also allowed values in MathScript!
But is this really working?
Matlab documentation is saying also that if you specify the 'pchip', 'spline', or 'makima' interpolation methods, then the default behavior of extrapolation is 'extrap'.
So what will happen if I run interp1 with method = 'pchip' and not assigned extrapolation?
Solved! Go to Solution.
05-10-2019 07:02 AM - edited 05-10-2019 07:03 AM
Extrapolation is default for all methods and available methods are cubic, linear, nearest, spline, pchip and v5cubic (can be checked in [LabVIEW]\vi.lib\imath\engines\lvmath2\RunTimeEngine\BuiltInFunctions\interpolate1d).
NI has incomplete documentation.