4779
|
1 ## Copyright (C) 1996 Auburn University. All rights reserved. |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
4779
|
9 ## |
7016
|
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. |
4779
|
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/>. |
4779
|
18 |
6945
|
19 ## Undocumented internal function. |
|
20 |
4779
|
21 ## -*- texinfo -*- |
|
22 ## @deftypefn {Function File} {} __tfl__ (@var{vec}) |
|
23 ## used internally in tf. |
|
24 ## strip leading zero coefficients to get the true polynomial length |
|
25 ## @end deftypefn |
|
26 |
|
27 function vec = __tfl__ (vec) |
|
28 |
|
29 while (length (vec) > 1 && vec(1) == 0) |
|
30 vec = vec (2:end); |
|
31 endwhile |
|
32 |
|
33 if (vec(1) == 0) |
|
34 warning ("tf: polynomial has no nonzero coefficients!") |
|
35 endif |
|
36 |
|
37 endfunction |