gfuncΒΆ
- Purpose:
Form vector with function values at equally spaced points by linear interpolation.
- Syntax:
[t, g] = gfunc(G, dt)- Description:
gfuncuses 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,
dtbeing defined by the variabledt. The number of linear segments (steps) is \((t_N-t_1)/dt\). The corresponding vectortis also computed. The result can be plotted by using the commandplot(t, g).