Mercurial > hg > octave-lyh
annotate scripts/polynomial/unmkpp.m @ 9051:1bf0ce0930be
Grammar check TexInfo in all .m files
Cleanup documentation sources to follow a few consistent rules.
Spellcheck was NOT done. (but will be in another changeset)
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Fri, 27 Mar 2009 22:31:03 -0700 |
parents | eb63fbe60fab |
children | 16f53d29049f |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2000, 2006, 2007, 2008 Paul Kienzle |
5824 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
5824 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
5824 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {[@var{x}, @var{p}, @var{n}, @var{k}, @var{d}] =} unmkpp (@var{pp}) | |
21 ## | |
22 ## Extract the components of a piece-wise polynomial structure @var{pp}. | |
23 ## These are as follows: | |
24 ## | |
25 ## @table @asis | |
26 ## @item @var{x} | |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
7017
diff
changeset
|
27 ## Sample points. |
5824 | 28 ## @item @var{p} |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
29 ## Polynomial coefficients for points in sample interval. @code{@var{p} |
5824 | 30 ## (@var{i}, :)} contains the coefficients for the polynomial over |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
31 ## interval @var{i} ordered from highest to lowest. If @code{@var{d} > |
7001 | 32 ## 1}, @code{@var{p} (@var{r}, @var{i}, :)} contains the coefficients for |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
33 ## the r-th polynomial defined on interval @var{i}. However, this is |
5824 | 34 ## stored as a 2-D array such that @code{@var{c} = reshape (@var{p} (:, |
35 ## @var{j}), @var{n}, @var{d})} gives @code{@var{c} (@var{i}, @var{r})} | |
36 ## is the j-th coefficient of the r-th polynomial over the i-th interval. | |
37 ## @item @var{n} | |
38 ## Number of polynomial pieces. | |
39 ## @item @var{k} | |
40 ## Order of the polynomial plus 1. | |
41 ## @item @var{d} | |
42 ## Number of polynomials defined for each interval. | |
43 ## @end table | |
44 ## | |
45 ## @seealso{mkpp, ppval, spline} | |
46 ## @end deftypefn | |
47 | |
48 function [x, P, n, k, d] = unmkpp (pp) | |
49 if (nargin == 0) | |
6046 | 50 print_usage (); |
5824 | 51 endif |
52 if (! isstruct (pp)) | |
53 error ("unmkpp: expecting piecewise polynomial structure"); | |
54 endif | |
55 x = pp.x; | |
56 P = pp.P; | |
57 n = pp.n; | |
58 k = pp.k; | |
59 d = pp.d; | |
60 endfunction |