Spline Toolbox
  Go to function:
    Search    Help Desk 
spmak    Examples   See Also

Put together a spline in B-form

Syntax

Description

spmak puts together a spline function in B-form, from minimal information, with the rest inferred from the input. fnbrk returns all the parts of the completed description. In this way, the actual data structure used for the storage of this form is easily modified without any effect on the various M-files using the construct.

If there are no arguments, you will be prompted for knots and coefs.

The coefficients may be d-vectors (e.g., 2-vectors or 3-vectors), in which case the resulting spline is a curve or surface (in 2-space or 3-space).

The action taken by spmak depends on whether the function is univariate or multivariate, as indicated by knots being a sequence or a cell-array.

If knots is a sequence (required to be non-decreasing), then the spline is taken to be univariate, of order k = length(knots) - size(coefs,2). This means that each column of coefs is taken to be a B-spline coefficient of the spline. This follows the general agreement in this package that, in case of a vector-valued spline, any vector in its target, be it a coefficient, or the value of the spline at a point, is written as a 1-column matrix. In particular, the spline is d-vector-valued, with d = size(coefs,1). Finally, the basic interval of the B-form is [knots(1) .. knots(end)].

Knot multiplicity is held to be k, with the coefficients corresponding to a B-spline with trivial support ignored.

If knots is a cell array, of length m, then the spline is taken to be m-variate, and coefs must be an (m+1)-dimensional array, - except when the spline is to be scalar-valued, in which case, in contrast to the univariate case, coefs is permitted to be an m-dimensional array, but this array is immediately reshaped by

With this, the ith entry of m-vector k is computed as length(knots{i}) - size(coef,i+1), i=1:m, and the ith entry of the cell array of basic intervals is set to [knots{i}(1), knots{i}(end)].

Examples

spmak([1:6],[0:2]) constructs a spline function with basic interval [1. .6], with 6 knots and 3 coefficients, hence of order 6 - 3 = 3. spmak(t,1) provides the B-spline B(.|t) in ppform. See spalldm2 for other examples.

See Also

spbrk, spalldm2

Diagnostics

There will be an error return if the proposed knot sequence fails to be nondecreasing or if there are not more knots than there are coefficients, or if the coefficient array is empty.

Limitations

It appears that, in MATLAB v.5.2, the size of a multidimensional array created by the statement reshape(1,[1,1,1,...,1]) will be reported as [1 1]. This means that the B-form created by the statement sp = spmak(knots,1), with knots a cell array of length m>2, will not be interpreted correctly, by fnval and other commands, as the tensor-product B-spline for the given knots.



[ Previous | Help Desk ]