gfuncΒΆ

Purpose:

Form vector with function values at equally spaced points by linear interpolation.

_images/f32.svg
Syntax:
[t, g] = gfunc(G, dt)
Description:

gfunc uses linear interpolation to compute values at equally spaced points for a discrete function \(g\) given by

\[\begin{split}G = \left[ \begin{array}{cc} t_1 & g(t_1)\\ t_2 & g(t_2)\\ \vdots \\ t_N & g(t_N) \end{array} \right],\end{split}\]

as shown in the figure above.

Function values are computed in the range \(t_1 \leq t \leq t_N\), at equal increments, dt being defined by the variable dt. The number of linear segments (steps) is \((t_N-t_1)/dt\). The corresponding vector t is also computed. The result can be plotted by using the command plot(t, g).