GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • » Octave core
  • » by package
  • » alphabetical

This view

  • Original page
  • New address

GeezerVison is showing octave.sourceforge.io — Function Reference: mkpp

Octave-Forge - Extra packages for GNU Octave
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code

Navigation

Operators and Keywords

Function List:

  • » Octave core
  • » by package
  • » alphabetical

C++ API

: pp = mkpp (breaks, coefs)
: pp = mkpp (breaks, coefs, d)

Construct a piecewise polynomial (pp) structure from sample points breaks and coefficients coefs.

breaks must be a vector of strictly increasing values. The number of intervals is given by ni = length (breaks) - 1.

When m is the polynomial order coefs must be of size: ni x m + 1.

The i-th row of coefs, coefs (i,:), contains the coefficients for the polynomial over the i-th interval, ordered from highest (m) to lowest (0).

coefs may also be a multi-dimensional array, specifying a vector-valued or array-valued polynomial. In that case the polynomial order is defined by the length of the last dimension of coefs. The size of first dimension(s) are given by the scalar or vector d. If d is not given it is set to 1. In any case coefs is reshaped to a 2-D matrix of size [ni*prod(d m)].

See also: unmkpp, ppval, spline, pchip, ppder, ppint, ppjumps.

Demonstration 1

The following code

 # linear interpolation
 x = linspace (0,pi,5)';
 t = [sin(x), cos(x)];
 m = diff (t) ./ (x(2)-x(1));
 b = t(1:4,:);
 pp = mkpp (x, [m(:),b(:)]);
 xi = linspace (0,pi,50);
 plot (x,t,"x", xi,ppval (pp,xi));
 legend ("control", "interp");

Produces the following figure

Figure 1

Package: octave

SourceForge.net Logo
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.