7017
|
1 ## Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007 |
|
2 ## Auburn University. All rights reserved. |
3431
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
7 ## under the terms of the GNU General Public License as published by |
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
3431
|
10 ## |
7016
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
3431
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
3431
|
19 |
|
20 ## -*- texinfo -*- |
3500
|
21 ## @deftypefn {Function File} {} freqchkw (@var{w}) |
5016
|
22 ## Used by @command{__freqresp__} to check that input frequency vector @var{w} |
3431
|
23 ## is valid. |
|
24 ## Returns boolean value. |
|
25 ## @end deftypefn |
|
26 |
|
27 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
28 ## Created: July 1996 |
|
29 |
|
30 function USEW = freqchkw (w) |
|
31 |
7125
|
32 if (nargin != 1) |
|
33 print_usage (); |
|
34 endif |
|
35 |
4462
|
36 if (isempty (w)) |
3431
|
37 USEW = 0; |
4462
|
38 elseif (! isvector (w)) |
|
39 error ("w (%dx%d): must be [], a vector or a scalar", |
|
40 rows (w), columns (w)); |
|
41 elseif (max (abs (imag(w))) != 0 && min (real (w)) <= 0) |
|
42 error ("w must have real positive entries"); |
3431
|
43 else |
4462
|
44 w = sort (w); |
|
45 USEW = 1; ## vector provided (check values later) |
3431
|
46 endif |
|
47 |
|
48 endfunction |