We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af35e77 commit 4857d28Copy full SHA for 4857d28
docs/src/index.md
@@ -36,3 +36,23 @@ Pkg.add("Interpolations")
36
```
37
38
from the Julia REPL.
39
+
40
+## Example Usage
41
+Create a grid `xs` and an array `A` of values to be interpolated
42
+```
43
+xs = 1:0.2:5
44
+f(x) = log(x)
45
+A = [f(x) for x in xs]
46
47
+Create linear interpolation object without extrapolation
48
49
+interp_linear = LinearInterpolation(xs, A)
50
+interp_linear(3) # exactly log(3)
51
+interp_linear(3.1) # approximately log(3.1)
52
+interp_linear(0.9) # outside grid: error
53
54
+Create linear interpolation object with extrapolation
55
56
+interp_linear_extrap = LinearInterpolation(xs, A,extrapolation_bc=Line())
57
+interp_linear_extrap(0.9) # outside grid: linear extrapolation
58
0 commit comments