annotate scripts/control/system/__tfl__.m @ 7016:93c65f2a5668

[project @ 2007-10-12 06:40:56 by jwe]
author jwe
date Fri, 12 Oct 2007 06:41:26 +0000
parents 6bbf56a9718a
children a1dbe9d80eee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4779
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 1996 Auburn University. All rights reserved.
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
2 ##
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
4 ##
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
diff changeset
6 ## under the terms of the GNU General Public License as published by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
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: 6945
diff changeset
8 ## your option) any later version.
4779
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
9 ##
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6945
diff changeset
13 ## General Public License for more details.
4779
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
14 ##
f105000ab25c [project @ 2004-02-17 02:34:33 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: 6945
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: 6945
diff changeset
17 ## <http://www.gnu.org/licenses/>.
4779
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
18
6945
6bbf56a9718a [project @ 2007-10-02 20:47:22 by jwe]
jwe
parents: 5307
diff changeset
19 ## Undocumented internal function.
6bbf56a9718a [project @ 2007-10-02 20:47:22 by jwe]
jwe
parents: 5307
diff changeset
20
4779
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
21 ## -*- texinfo -*-
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
22 ## @deftypefn {Function File} {} __tfl__ (@var{vec})
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
23 ## used internally in tf.
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
24 ## strip leading zero coefficients to get the true polynomial length
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
25 ## @end deftypefn
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
26
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
27 function vec = __tfl__ (vec)
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
28
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
29 while (length (vec) > 1 && vec(1) == 0)
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
30 vec = vec (2:end);
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
31 endwhile
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
32
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
33 if (vec(1) == 0)
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
34 warning ("tf: polynomial has no nonzero coefficients!")
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
35 endif
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
36
f105000ab25c [project @ 2004-02-17 02:34:33 by jwe]
jwe
parents:
diff changeset
37 endfunction