annotate scripts/polynomial/residue.m @ 20165:f1d0f506ee78 stable

doc: Update more docstrings to have one sentence summary as first line. Reviewed optimization, polynomial, signal script directories. * scripts/optimization/fminbnd.m, scripts/optimization/fminsearch.m, scripts/optimization/fminunc.m, scripts/optimization/fsolve.m, scripts/optimization/fzero.m, scripts/optimization/glpk.m, scripts/optimization/lsqnonneg.m, scripts/optimization/pqpnonneg.m, scripts/optimization/qp.m, scripts/optimization/sqp.m, scripts/polynomial/compan.m, scripts/polynomial/mkpp.m, scripts/polynomial/mpoles.m, scripts/polynomial/pchip.m, scripts/polynomial/poly.m, scripts/polynomial/polyaffine.m, scripts/polynomial/polyder.m, scripts/polynomial/polyeig.m, scripts/polynomial/polyfit.m, scripts/polynomial/polygcd.m, scripts/polynomial/polyint.m, scripts/polynomial/polyout.m, scripts/polynomial/polyval.m, scripts/polynomial/ppder.m, scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m, scripts/polynomial/ppval.m, scripts/polynomial/residue.m, scripts/polynomial/roots.m, scripts/polynomial/spline.m, scripts/polynomial/splinefit.m, scripts/polynomial/unmkpp.m, scripts/signal/arch_fit.m, scripts/signal/arch_rnd.m, scripts/signal/arma_rnd.m, scripts/signal/autoreg_matrix.m, scripts/signal/bartlett.m, scripts/signal/blackman.m, scripts/signal/detrend.m, scripts/signal/diffpara.m, scripts/signal/durbinlevinson.m, scripts/signal/fftconv.m, scripts/signal/fftfilt.m, scripts/signal/fftshift.m, scripts/signal/filter2.m, scripts/signal/freqz.m, scripts/signal/hamming.m, scripts/signal/hanning.m, scripts/signal/hurst.m, scripts/signal/ifftshift.m, scripts/signal/periodogram.m, scripts/signal/sinc.m, scripts/signal/sinetone.m, scripts/signal/sinewave.m, scripts/signal/spectral_adf.m, scripts/signal/spectral_xdf.m, scripts/signal/spencer.m, scripts/signal/stft.m, scripts/signal/synthesis.m, scripts/signal/unwrap.m, scripts/signal/yulewalker.m: Update more docstrings to have one sentence summary as first line.
author Rik <rik@octave.org>
date Mon, 04 May 2015 21:50:57 -0700
parents 9fc020886ae9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
1 ## Copyright (C) 1994-2015 John W. Eaton
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
2 ## Copyright (C) 2007 Ben Abbott
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
3 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
4 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
5 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
7 ## 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: 7011
diff changeset
8 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7011
diff changeset
9 ## your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
10 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
14 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
15 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
16 ## 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: 7011
diff changeset
17 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7011
diff changeset
18 ## <http://www.gnu.org/licenses/>.
904
3470f1e25a79 [project @ 1994-11-09 21:22:15 by jwe]
jwe
parents: 559
diff changeset
19
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
20 ## -*- texinfo -*-
13929
9cae456085c2 Grammarcheck of documentation before 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents: 13128
diff changeset
21 ## @deftypefn {Function File} {[@var{r}, @var{p}, @var{k}, @var{e}] =} residue (@var{b}, @var{a})
13127
435d1b905e31 Update residue.m's docstring to more modern form, all calling forms on top
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 11587
diff changeset
22 ## @deftypefnx {Function File} {[@var{b}, @var{a}] =} residue (@var{r}, @var{p}, @var{k})
435d1b905e31 Update residue.m's docstring to more modern form, all calling forms on top
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 11587
diff changeset
23 ## @deftypefnx {Function File} {[@var{b}, @var{a}] =} residue (@var{r}, @var{p}, @var{k}, @var{e})
435d1b905e31 Update residue.m's docstring to more modern form, all calling forms on top
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 11587
diff changeset
24 ## The first calling form computes the partial fraction expansion for the
435d1b905e31 Update residue.m's docstring to more modern form, all calling forms on top
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 11587
diff changeset
25 ## quotient of the polynomials, @var{b} and @var{a}.
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
26 ##
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
27 ## The quotient is defined as
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
28 ## @tex
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
29 ## $$
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
30 ## {B(s)\over A(s)} = \sum_{m=1}^M {r_m\over (s-p_m)^e_m}
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
31 ## + \sum_{i=1}^N k_i s^{N-i}.
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
32 ## $$
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
33 ## @end tex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
34 ## @ifnottex
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3368
diff changeset
35 ##
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
36 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
37 ## @group
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
38 ## B(s) M r(m) N
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
39 ## ---- = SUM ------------- + SUM k(i)*s^(N-i)
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
40 ## A(s) m=1 (s-p(m))^e(m) i=1
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
41 ## @end group
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
42 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10224
diff changeset
43 ##
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
44 ## @end ifnottex
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
45 ## @noindent
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
46 ## where @math{M} is the number of poles (the length of the @var{r}, @var{p},
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
47 ## and @var{e}), the @var{k} vector is a polynomial of order @math{N-1}
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
48 ## representing the direct contribution, and the @var{e} vector specifies the
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
49 ## multiplicity of the m-th residue's pole.
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3368
diff changeset
50 ##
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
51 ## For example,
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3368
diff changeset
52 ##
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
53 ## @example
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
54 ## @group
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
55 ## b = [1, 1, 1];
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
56 ## a = [1, -5, 8, -4];
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
57 ## [r, p, k, e] = residue (b, a)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
58 ## @result{} r = [-2; 7; 3]
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
59 ## @result{} p = [2; 2; 1]
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
60 ## @result{} k = [](0x0)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
61 ## @result{} e = [1; 2; 1]
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
62 ## @end group
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
63 ## @end example
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3368
diff changeset
64 ##
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
65 ## @noindent
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
66 ## which represents the following partial fraction expansion
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
67 ## @tex
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
68 ## $$
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
69 ## {s^2+s+1\over s^3-5s^2+8s-4} = {-2\over s-2} + {7\over (s-2)^2} + {3\over s-1}
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
70 ## $$
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
71 ## @end tex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
72 ## @ifnottex
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3368
diff changeset
73 ##
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
74 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
75 ## @group
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
76 ## s^2 + s + 1 -2 7 3
2311
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
77 ## ------------------- = ----- + ------- + -----
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
78 ## s^3 - 5s^2 + 8s - 4 (s-2) (s-2)^2 (s-1)
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
79 ## @end group
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
80 ## @end example
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
81 ##
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
82 ## @end ifnottex
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
83 ##
20165
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
84 ## The second calling form performs the inverse operation and computes the
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
85 ## reconstituted quotient of polynomials, @var{b}(s)/@var{a}(s), from the
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
86 ## partial fraction expansion; represented by the residues, poles, and a direct
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
87 ## polynomial specified by @var{r}, @var{p} and @var{k}, and the pole
f1d0f506ee78 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
88 ## multiplicity @var{e}.
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
89 ##
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
90 ## If the multiplicity, @var{e}, is not explicitly specified the multiplicity is
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10224
diff changeset
91 ## determined by the function @code{mpoles}.
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
92 ##
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10224
diff changeset
93 ## For example:
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
94 ##
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
95 ## @example
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
96 ## @group
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
97 ## r = [-2; 7; 3];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
98 ## p = [2; 2; 1];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
99 ## k = [1, 0];
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
100 ## [b, a] = residue (r, p, k)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
101 ## @result{} b = [1, -5, 9, -3, 1]
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
102 ## @result{} a = [1, -5, 8, -4]
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
103 ##
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10224
diff changeset
104 ## where mpoles is used to determine e = [1; 2; 1]
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
105 ## @end group
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
106 ## @end example
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
107 ##
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
108 ## Alternatively the multiplicity may be defined explicitly, for example,
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
109 ##
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
110 ## @example
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
111 ## @group
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
112 ## r = [7; 3; -2];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
113 ## p = [2; 1; 2];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
114 ## k = [1, 0];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
115 ## e = [2; 1; 1];
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
116 ## [b, a] = residue (r, p, k, e)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
117 ## @result{} b = [1, -5, 9, -3, 1]
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
118 ## @result{} a = [1, -5, 8, -4]
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
119 ## @end group
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
120 ## @end example
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
121 ##
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
122 ## @noindent
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
123 ## which represents the following partial fraction expansion
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
124 ## @tex
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
125 ## $$
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
126 ## {-2\over s-2} + {7\over (s-2)^2} + {3\over s-1} + s = {s^4-5s^3+9s^2-3s+1\over s^3-5s^2+8s-4}
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
127 ## $$
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
128 ## @end tex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
129 ## @ifnottex
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
130 ##
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
131 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
132 ## @group
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
133 ## -2 7 3 s^4 - 5s^3 + 9s^2 - 3s + 1
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
134 ## ----- + ------- + ----- + s = --------------------------
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
135 ## (s-2) (s-2)^2 (s-1) s^3 - 5s^2 + 8s - 4
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
136 ## @end group
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
137 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10224
diff changeset
138 ##
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8494
diff changeset
139 ## @end ifnottex
14104
614505385171 doc: Overhaul docstrings for polynomial functions.
Rik <octave@nomad.inbox5.com>
parents: 13963
diff changeset
140 ## @seealso{mpoles, poly, roots, conv, deconv}
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 3202
diff changeset
141 ## @end deftypefn
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
142
3202
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 2847
diff changeset
143 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
144 ## Author: Ben Abbott <bpabbott@mac.com>
2312
204cc7db6f4a [project @ 1996-07-11 21:20:36 by jwe]
jwe
parents: 2311
diff changeset
145 ## Created: June 1994
204cc7db6f4a [project @ 1996-07-11 21:20:36 by jwe]
jwe
parents: 2311
diff changeset
146 ## Adapted-By: jwe
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
147
6978
b75630794a11 [project @ 2007-10-08 19:41:28 by jwe]
jwe
parents: 6968
diff changeset
148 function [r, p, k, e] = residue (b, a, varargin)
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
149
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
150 if (nargin < 2 || nargin > 4)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5670
diff changeset
151 print_usage ();
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
152 endif
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
153
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
154 toler = .001;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
155
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
156 if (nargin >= 3)
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
157 if (nargin >= 4)
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
158 e = varargin{2};
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
159 else
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
160 e = [];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
161 endif
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
162 ## The inputs are the residue, pole, and direct part. Solve for the
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
163 ## corresponding numerator and denominator polynomials
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
164 [r, p] = rresidue (b, a, varargin{1}, toler, e);
17312
088d014a7fe2 Use semicolon after "return" statement in core m-files.
Rik <rik@octave.org>
parents: 14868
diff changeset
165 return;
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
166 endif
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
167
2303
5cffc4b8de57 [project @ 1996-06-24 09:15:24 by jwe]
jwe
parents: 1887
diff changeset
168 ## Make sure both polynomials are in reduced form.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
169
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
170 a = polyreduce (a);
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
171 b = polyreduce (b);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
172
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
173 b = b / a(1);
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
174 a = a / a(1);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
175
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
176 la = length (a);
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
177 lb = length (b);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
178
2303
5cffc4b8de57 [project @ 1996-06-24 09:15:24 by jwe]
jwe
parents: 1887
diff changeset
179 ## Handle special cases here.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
180
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
181 if (la == 0 || lb == 0)
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
182 k = r = p = e = [];
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
183 return;
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
184 elseif (la == 1)
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
185 k = b / a;
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
186 r = p = e = [];
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
187 return;
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
188 endif
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
189
2303
5cffc4b8de57 [project @ 1996-06-24 09:15:24 by jwe]
jwe
parents: 1887
diff changeset
190 ## Find the poles.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
191
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
192 p = roots (a);
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
193 lp = length (p);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
194
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
195 ## Sort poles so that multiplicity loop will work.
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
196
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
197 [e, indx] = mpoles (p, toler, 1);
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
198 p = p(indx);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
199
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
200 ## For each group of pole multiplicity, set the value of each
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
201 ## pole to the average of the group. This reduces the error in
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
202 ## the resulting poles.
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
203
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
204 p_group = cumsum (e == 1);
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
205 for ng = 1:p_group(end)
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
206 m = find (p_group == ng);
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
207 p(m) = mean (p(m));
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
208 endfor
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
209
2303
5cffc4b8de57 [project @ 1996-06-24 09:15:24 by jwe]
jwe
parents: 1887
diff changeset
210 ## Find the direct term if there is one.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
211
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
212 if (lb >= la)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
213 ## Also return the reduced numerator.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
214 [k, b] = deconv (b, a);
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
215 lb = length (b);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
216 else
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
217 k = [];
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
218 endif
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
219
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
220 ## Determine if the poles are (effectively) zero.
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
221
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
222 small = max (abs (p));
7795
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
223 if (isa (a, "single") || isa (b, "single"))
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
224 small = max ([small, 1]) * eps ("single") * 1e4 * (1 + numel (p))^2;
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
225 else
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
226 small = max ([small, 1]) * eps * 1e4 * (1 + numel (p))^2;
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
227 endif
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
228 p(abs (p) < small) = 0;
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
229
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
230 ## Determine if the poles are (effectively) real, or imaginary.
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
231
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
232 index = (abs (imag (p)) < small);
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
233 p(index) = real (p(index));
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
234 index = (abs (real (p)) < small);
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
235 p(index) = 1i * imag (p(index));
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
236
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
237 ## The remainder determines the residues. The case of one pole
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
238 ## is trivial.
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
239
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
240 if (lp == 1)
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
241 r = polyval (b, p);
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
242 return;
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
243 endif
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
244
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
245 ## Determine the order of the denominator and remaining numerator.
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
246 ## With the direct term removed the potential order of the numerator
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
247 ## is one less than the order of the denominator.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
248
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
249 aorder = numel (a) - 1;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
250 border = aorder - 1;
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
251
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
252 ## Construct a system of equations relating the individual
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
253 ## contributions from each residue to the complete numerator.
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
254
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
255 A = zeros (border+1, border+1);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
256 B = prepad (reshape (b, [numel(b), 1]), border+1, 0);
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14552
diff changeset
257 for ip = 1:numel (p)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
258 ri = zeros (size (p));
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
259 ri(ip) = 1;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
260 A(:,ip) = prepad (rresidue (ri, p, [], toler), border+1, 0).';
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
261 endfor
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
262
2303
5cffc4b8de57 [project @ 1996-06-24 09:15:24 by jwe]
jwe
parents: 1887
diff changeset
263 ## Solve for the residues.
1025
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
264
f558749713f1 [project @ 1995-01-11 20:52:10 by jwe]
jwe
parents: 904
diff changeset
265 r = A \ B;
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
266
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
267 endfunction
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
268
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
269 function [pnum, pden, e] = rresidue (r, p, k, toler, e)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
270
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
271 ## Reconstitute the numerator and denominator polynomials from the
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
272 ## residues, poles, and direct term.
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
273
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
274 if (nargin < 2 || nargin > 5)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
275 print_usage ();
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
276 endif
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
277
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
278 if (nargin < 5)
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
279 e = [];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
280 endif
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
281
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
282 if (nargin < 4)
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
283 toler = [];
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
284 endif
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
285
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
286 if (nargin < 3)
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
287 k = [];
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
288 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
289
14552
86854d032a37 maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents: 14363
diff changeset
290 if (numel (e))
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14552
diff changeset
291 indx = 1:numel (p);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
292 else
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
293 [e, indx] = mpoles (p, toler, 0);
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
294 p = p(indx);
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
295 r = r(indx);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
296 endif
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
297
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14552
diff changeset
298 indx = 1:numel (p);
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
299
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
300 for n = indx
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
301 pn = [1, -p(n)];
14552
86854d032a37 maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents: 14363
diff changeset
302 if (n == 1)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
303 pden = pn;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
304 else
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
305 pden = conv (pden, pn);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
306 endif
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
307 endfor
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
308
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
309 ## D is the order of the denominator
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
310 ## K is the order of the direct polynomial
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
311 ## N is the order of the resulting numerator
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
312 ## pnum(1:(N+1)) is the numerator's polynomial
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
313 ## pden(1:(D+1)) is the denominator's polynomial
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
314 ## pm is the multible pole for the nth residue
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
315 ## pn is the numerator contribution for the nth residue
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
316
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
317 D = numel (pden) - 1;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
318 K = numel (k) - 1;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
319 N = K + D;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
320 pnum = zeros (1, N+1);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
321 for n = indx(abs (r) > 0)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
322 p1 = [1, -p(n)];
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
323 for m = 1:e(n)
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
324 if (m == 1)
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
325 pm = p1;
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
326 else
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
327 pm = conv (pm, p1);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
328 endif
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
329 endfor
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
330 pn = deconv (pden, pm);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
331 pn = r(n) * pn;
7183
c0be321eb472 [project @ 2007-11-26 18:31:53 by jwe]
jwe
parents: 7017
diff changeset
332 pnum = pnum + prepad (pn, N+1, 0, 2);
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
333 endfor
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
334
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
335 ## Add the direct term.
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
336
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
337 if (numel (k))
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
338 pnum = pnum + conv (pden, k);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
339 endif
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
340
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
341 ## Check for leading zeros and trim the polynomial coefficients.
7795
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
342 if (isa (r, "single") || isa (p, "single") || isa (k, "single"))
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
343 small = max ([max(abs(pden)), max(abs(pnum)), 1]) * eps ("single");
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
344 else
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
345 small = max ([max(abs(pden)), max(abs(pnum)), 1]) * eps;
df9519e9990c Handle single precision eps values
David Bateman <dbateman@free.fr>
parents: 7398
diff changeset
346 endif
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
347
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
348 pnum(abs (pnum) < small) = 0;
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
349 pden(abs (pden) < small) = 0;
6964
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
350
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
351 pnum = polyreduce (pnum);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
352 pden = polyreduce (pden);
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
353
33f20a41aeea [project @ 2007-10-06 04:31:18 by jwe]
jwe
parents: 6046
diff changeset
354 endfunction
6968
c8fc3487ed2c [project @ 2007-10-06 12:57:58 by jwe]
jwe
parents: 6964
diff changeset
355
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
356
6968
c8fc3487ed2c [project @ 2007-10-06 12:57:58 by jwe]
jwe
parents: 6964
diff changeset
357 %!test
c8fc3487ed2c [project @ 2007-10-06 12:57:58 by jwe]
jwe
parents: 6964
diff changeset
358 %! b = [1, 1, 1];
c8fc3487ed2c [project @ 2007-10-06 12:57:58 by jwe]
jwe
parents: 6964
diff changeset
359 %! a = [1, -5, 8, -4];
c8fc3487ed2c [project @ 2007-10-06 12:57:58 by jwe]
jwe
parents: 6964
diff changeset
360 %! [r, p, k, e] = residue (b, a);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
361 %! assert (r, [-2; 7; 3], 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
362 %! assert (p, [2; 2; 1], 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
363 %! assert (isempty (k));
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
364 %! assert (e, [1; 2; 1]);
6994
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
365 %! k = [1 0];
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
366 %! b = conv (k, a) + prepad (b, numel (k) + numel (a) - 1, 0);
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
367 %! a = a;
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
368 %! [br, ar] = residue (r, p, k);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
369 %! assert (br, b, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
370 %! assert (ar, a, 1e-12);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
371 %! [br, ar] = residue (r, p, k, e);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
372 %! assert (br, b, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
373 %! assert (ar, a, 1e-12);
6994
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
374
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
375 %!test
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
376 %! b = [1, 0, 1];
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
377 %! a = [1, 0, 18, 0, 81];
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
378 %! [r, p, k, e] = residue (b, a);
6994
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
379 %! r1 = [-5i; 12; +5i; 12]/54;
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
380 %! p1 = [+3i; +3i; -3i; -3i];
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
381 %! assert (r, r1, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
382 %! assert (p, p1, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
383 %! assert (isempty (k));
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
384 %! assert (e, [1; 2; 1; 2]);
6994
3fbf49bde6d4 [project @ 2007-10-10 00:21:29 by jwe]
jwe
parents: 6978
diff changeset
385 %! [br, ar] = residue (r, p, k);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
386 %! assert (br, b, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
387 %! assert (ar, a, 1e-12);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
388
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
389 %!test
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
390 %! r = [7; 3; -2];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
391 %! p = [2; 1; 2];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
392 %! k = [1 0];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
393 %! e = [2; 1; 1];
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
394 %! [b, a] = residue (r, p, k, e);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
395 %! assert (b, [1, -5, 9, -3, 1], 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
396 %! assert (a, [1, -5, 8, -4], 1e-12);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
397 %! [rr, pr, kr, er] = residue (b, a);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
398 %! [jnk, n] = mpoles (p);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
399 %! assert (rr, r(n), 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
400 %! assert (pr, p(n), 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
401 %! assert (kr, k, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
402 %! assert (er, e(n), 1e-12);
7011
4a682c7b2bd6 [project @ 2007-10-11 17:54:48 by jwe]
jwe
parents: 6998
diff changeset
403
7188
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
404 %!test
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
405 %! b = [1];
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
406 %! a = [1, 10, 25];
7398
4f403ccc4e30 [project @ 2008-01-18 05:47:59 by jwe]
jwe
parents: 7188
diff changeset
407 %! [r, p, k, e] = residue (b, a);
7188
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
408 %! r1 = [0; 1];
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
409 %! p1 = [-5; -5];
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
410 %! assert (r, r1, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
411 %! assert (p, p1, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
412 %! assert (isempty (k));
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
413 %! assert (e, [1; 2]);
7188
fdd7cd70dc14 [project @ 2007-11-26 20:31:25 by jwe]
jwe
parents: 7183
diff changeset
414 %! [br, ar] = residue (r, p, k);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
415 %! assert (br, b, 1e-12);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
416 %! assert (ar, a, 1e-12);
13128
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
417
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
418 ## The following test is due to Bernard Grung (bug #34266)
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
419 %!xtest
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
420 %! z1 = 7.0372976777e6;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
421 %! p1 = -3.1415926536e9;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
422 %! p2 = -4.9964813512e8;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
423 %! r1 = -(1 + z1/p1)/(1 - p1/p2)/p2/p1;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
424 %! r2 = -(1 + z1/p2)/(1 - p2/p1)/p2/p1;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
425 %! r3 = (1 + (p2 + p1)/p2/p1*z1)/p2/p1;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
426 %! r4 = z1/p2/p1;
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
427 %! r = [r1; r2; r3; r4];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
428 %! p = [p1; p2; 0; 0];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
429 %! k = [];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
430 %! e = [1; 1; 1; 2];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
431 %! b = [1, z1];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
432 %! a = [1, -(p1 + p2), p1*p2, 0, 0];
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
433 %! [br, ar] = residue (r, p, k, e);
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
434 %! assert (br, b, 1e-8);
d049192e5d15 Add test f for bug #34266
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13127
diff changeset
435 %! assert (ar, a, 1e-8);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14327
diff changeset
436