annotate scripts/polynomial/unmkpp.m @ 12541:dd2c70b30f28

Add tests for ifftshift.m
author Robert T. Short <octave@phaselockedsystems.com.com>
date Sat, 26 Mar 2011 06:50:12 -0700
parents c792872f8942
children 59e2460acae1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 10821
diff changeset
1 ## Copyright (C) 2000-2011 Paul Kienzle
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
2 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
4 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
8 ## your option) any later version.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
9 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
14 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
17 ## <http://www.gnu.org/licenses/>.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
18
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
20 ## @deftypefn {Function File} {[@var{x}, @var{p}, @var{n}, @var{k}, @var{d}] =} unmkpp (@var{pp})
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
21 ##
11536
702dbd0c53f5 Add undocumented ppder, ppint, ppjumps functions to documentation.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
22 ## Extract the components of a piecewise polynomial structure @var{pp}.
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
23 ## These are as follows:
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
24 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
25 ## @table @asis
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
26 ## @item @var{x}
8347
fa78cb8d8a5c corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents: 7017
diff changeset
27 ## Sample points.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 9768
diff changeset
28 ##
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
29 ## @item @var{p}
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
30 ## Polynomial coefficients for points in sample interval. @code{@var{p}
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
31 ## (@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
32 ## interval @var{i} ordered from highest to lowest. If @code{@var{d} >
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11536
diff changeset
33 ## 1}, @code{@var{p} (@var{r}, @var{i}, :)} contains the coefficients for
9768
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
34 ## the r-th polynomial defined on interval @var{i}.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 9768
diff changeset
35 ##
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
36 ## @item @var{n}
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
37 ## Number of polynomial pieces.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 9768
diff changeset
38 ##
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
39 ## @item @var{k}
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
40 ## Order of the polynomial plus 1.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 9768
diff changeset
41 ##
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
42 ## @item @var{d}
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
43 ## Number of polynomials defined for each interval.
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
44 ## @end table
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
45 ##
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
46 ## @seealso{mkpp, ppval, spline}
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
47 ## @end deftypefn
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
48
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
49 function [x, P, n, k, d] = unmkpp (pp)
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
50 if (nargin == 0)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5824
diff changeset
51 print_usage ();
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
52 endif
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
53 if (! isstruct (pp))
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
54 error ("unmkpp: expecting piecewise polynomial structure");
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
55 endif
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
56 x = pp.x;
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
57 P = pp.P;
9768
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
58 n = size (P, 2);
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
59 k = size (P, 3);
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
60 d = pp.d;
9768
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
61 if (d == 1)
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
62 P = reshape (P, n, k);
31900e17b5f5 improve Matlab compatibility & performance of ppval/mkpp and some associated funcs
Jaroslav Hajek <highegg@gmail.com>
parents: 9245
diff changeset
63 endif
5824
448f9982e7fb [project @ 2006-05-19 06:53:31 by jwe]
jwe
parents:
diff changeset
64 endfunction