Mercurial > hg > octave-nkf
annotate scripts/polynomial/polyint.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) 1996, 1997, 2007, 2008 John W. Eaton |
6853 | 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. | |
6853 | 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/>. | |
6853 | 18 |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} polyint (@var{c}, @var{k}) | |
21 ## Return the coefficients of the integral of the polynomial whose | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
22 ## coefficients are represented by the vector @var{c}. The variable |
6853 | 23 ## @var{k} is the constant of integration, which by default is set to zero. |
24 ## @seealso{poly, polyderiv, polyreduce, roots, conv, deconv, residue, | |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7151
diff
changeset
|
25 ## filter, polyval, polyvalm} |
6853 | 26 ## @end deftypefn |
27 | |
28 ## Author: Tony Richardson <arichard@stark.cc.oh.us> | |
29 ## Created: June 1994 | |
30 ## Adapted-By: jwe | |
31 | |
32 function p = polyint (p, k) | |
33 | |
34 if (nargin < 1 || nargin > 2) | |
35 print_usage (); | |
36 endif | |
37 | |
38 if (nargin == 1) | |
39 k = 0; | |
40 elseif (! isscalar (k)) | |
41 error ("polyint: the constant of integration must be a scalar"); | |
42 endif | |
43 | |
44 if (! (isvector (p) || isempty (p))) | |
45 error ("argument must be a vector"); | |
46 endif | |
47 | |
48 lp = length (p); | |
49 | |
50 if (lp == 0) | |
51 p = []; | |
52 return; | |
7151 | 53 endif |
6853 | 54 |
55 if (rows (p) > 1) | |
56 ## Convert to column vector | |
57 p = p.'; | |
58 endif | |
59 | |
60 p = [(p ./ [lp:-1:1]), k]; | |
61 | |
62 endfunction |