# Plot interpolating function depending on free variable inside manipulate

I create an interpolating function which depends on some free variables. I then want to plot it inside a manipulate, but my output is empty.

What am I doing wrong?

points = {{0, 1}, {8, low}, {12, mid}, {24, 0.1}, {35, mid}, {50,
low}, {end, 1}};
g = Interpolation[{0, 1}, {2, 3}, InterpolationOrder -> 1];
Manipulate[
Plot[g,
{x, 0, 100},
Frame -> True,
PlotRange -> {0, 1}
],
{low, 1, 0.6, Appearance -> "Labeled"},
{mid, 0.6, 0.2, Appearance -> "Labeled"},
{end, 58, 100, Appearance -> "Labeled"}
]


It's not completely clear to me what you want to achieve, but see below if that's what you need:

Manipulate[
points = {{0, 1}, {8, low}, {12, mid}, {24, 0.1}, {35, mid}, {50,
low}, {end, 1}};
g = Interpolation[points, InterpolationOrder -> 1];

Plot[g[x], {x, 0, 100}
, Frame -> True
, PlotRange -> {0, 1}]

,
{low, 1, 0.6, Appearance -> "Labeled"},
{mid, 0.6, 0.2, Appearance -> "Labeled"},
{end, 58, 100, Appearance -> "Labeled"}]

• thank you! this I what I was looking for. The rendering is a bit slow, is it possible to improve the speed? Commented Jun 12, 2018 at 11:56
• It's not the rendering to be slow, the problem is that every time you change one slider in the manipulate, MMA is calculating again the interpolation (and then plotting it, which should be fast). I'm not aware of an Interpolation function with free parameters (it sounds a bit as a contradiction to me), but maybe someone else can enlighten us about it :) Commented Jun 12, 2018 at 12:03