Interpl1 with golang (like matlab)

Hello,

I am looking for this function
https://de.mathworks.com/help/matlab/ref/interp1.html

“interp1(x,v,xq)”

vq = interp1(x,v,xq) returns interpolated values of a 1-D function at specific query points using linear interpolation. Vector x contains the sample points, and v contains the corresponding values, v(x). Vector xq contains the coordinates of the query points. If you have multiple sets of data that are sampled at the same point coordinates, then you can pass v as an array. Each column of array v contains a different set of 1-D sample values.

Is there an implementation in golang?

This javascript version work fine


but maybe there is already an existing go version…

Thanks and best regards
Simon


Update, I made quick transform to golang, and runs fine so far
https://play.golang.org/p/VHLE-lLTx3A
it’s a easier than I initially thought…


1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.