In [1]:
Pkg.checkout("MyinterpolationA")
In [2]:
using MyinterpolationA
In [3]:
grid = [1, 2]
vals = [2, 0]
f = myinterpolationA(grid, vals)
f(1.25)
# 1.5 が返ってくるはず
Out[3]:
In [4]:
Pkg.test("MyinterpolationA")
In [5]:
using Plots
In [6]:
plotly()
Out[6]:
In [7]:
x = -7:7
y = sin.(x)
xf = -7:0.1:7
plot(xf, sin.(xf), label= "sine function")
scatter!(x, y, label="sampled data", markersize=4)
Out[7]:
In [8]:
li = myinterpolationA(x, y)
y_linear_qe = li.(xf)
plot(xf, y_linear_qe, label = "linear")
scatter!(x, y, label="sampled data", markersize=4)
Out[8]:
In [ ]:
In [ ]: