annotate scripts/general/interpft.m @ 20830:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 7503499a252b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19898
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
1 ## Copyright (C) 2001-2015 Paul Kienzle
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
2 ##
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
4 ##
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
6 ## 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: 7001
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: 7001
diff changeset
8 ## your option) any later version.
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
9 ##
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
14 ##
55404f3b0da1 [project @ 2006-06-01 19:05:31 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: 7001
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: 7001
diff changeset
17 ## <http://www.gnu.org/licenses/>.
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
18
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 9051
diff changeset
20 ## @deftypefn {Function File} {} interpft (@var{x}, @var{n})
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
21 ## @deftypefnx {Function File} {} interpft (@var{x}, @var{n}, @var{dim})
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
22 ##
20368
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
23 ## Fourier interpolation.
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
24 ##
20368
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
25 ## If @var{x} is a vector then @var{x} is resampled with @var{n} points. The
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
26 ## data in @var{x} is assumed to be equispaced. If @var{x} is a matrix or an
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
27 ## N-dimensional array, the interpolation is performed on each column of
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
28 ## @var{x}.
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
29 ##
20368
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
30 ## If @var{dim} is specified, then interpolate along the dimension @var{dim}.
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
31 ##
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
32 ## @code{interpft} assumes that the interpolated function is periodic, and so
7503499a252b doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20038
diff changeset
33 ## assumptions are made about the endpoints of the interpolation.
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
34 ## @seealso{interp1}
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
35 ## @end deftypefn
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
36
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
37 ## Author: Paul Kienzle
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
38 ## 2001-02-11
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
39 ## * initial version
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
40 ## 2002-03-17 aadler
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
41 ## * added code to work on matrices as well
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
42 ## 2006-05-25 dbateman
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
43 ## * Make it matlab compatiable, cutting out the 2-D interpolation
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
44
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
45 function z = interpft (x, n, dim)
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
46
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
47 if (nargin < 2 || nargin > 3)
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
48 print_usage ();
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
49 endif
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
50
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
51 if (! (isscalar (n) && n == fix (n)))
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
52 error ("interpft: N must be a scalar integer");
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
53 endif
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
54
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
55 if (nargin == 2)
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
56 if (isrow (x))
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
57 dim = 2;
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
58 else
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
59 dim = 1;
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
60 endif
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
61 endif
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
62
5838
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
63 nd = ndims (x);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
64
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
65 if (dim < 1 || dim > nd)
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
66 error ("interpft: invalid dimension DIM");
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
67 endif
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
68
5838
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
69 perm = [dim:nd, 1:(dim-1)];
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
70 x = permute (x, perm);
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
71 m = rows (x);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
72
17089
3cbbdb49b8ff interpft.m: Fix decimation by a non-integer factor (bug #39017)
Mike Miller <mtmiller@ieee.org>
parents: 17087
diff changeset
73 inc = ceil (m/n);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
74 y = fft (x) / m;
17173
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
75 k = ceil (m / 2);
5838
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
76 sz = size (x);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
77 sz(1) = n * inc - m;
12676
2783fa95cab7 Use common code idiom for creating cell array for indexing ND-arrays
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
78
2783fa95cab7 Use common code idiom for creating cell array for indexing ND-arrays
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
79 idx = repmat ({':'}, nd, 1);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
80 idx{1} = 1:k;
5838
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
81 z = cat (1, y(idx{:}), zeros (sz));
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
82 idx{1} = k+1:m;
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
83 z = cat (1, z, y(idx{:}));
17173
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
84
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
85 ## When m is an even number of rows, the FFT has a single Nyquist bin.
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
86 ## If zero-padded above, distribute the value of the Nyquist bin evenly
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
87 ## between the new corresponding positive and negative frequency bins.
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
88 if (sz(1) > 0 && k == m/2)
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
89 idx{1} = n * inc - k + 1;
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
90 tmp = z(idx{:}) / 2;
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
91 z(idx{:}) = tmp;
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
92 idx{1} = k + 1;
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
93 z(idx{:}) = tmp;
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
94 endif
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
95
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
96 z = n * ifft (z);
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
97
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
98 if (inc != 1)
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
99 sz(1) = n;
5838
376e02b2ce70 [project @ 2006-06-01 20:23:53 by jwe]
jwe
parents: 5837
diff changeset
100 z = inc * reshape (z(1:inc:end), sz);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
101 endif
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
102
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
103 z = ipermute (z, perm);
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
104
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
105 endfunction
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
106
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
107
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
108 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
109 %! clf;
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
110 %! t = 0 : 0.3 : pi; dt = t(2)-t(1);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
111 %! n = length (t); k = 100;
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
112 %! ti = t(1) + [0 : k-1]*dt*n/k;
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
113 %! y = sin (4*t + 0.3) .* cos (3*t - 0.1);
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
114 %! yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1);
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
115 %! plot (ti, yp, 'g', ti, interp1(t, y, ti, "spline"), 'b', ...
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
116 %! ti, interpft (y, k), 'c', t, y, "r+");
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
117 %! legend ("sin(4t+0.3)cos(3t-0.1)", "spline", "interpft", "data");
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
118
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
119 %!shared n,y
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
120 %! x = [0:10]'; y = sin(x); n = length (x);
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
121 %!assert (interpft (y, n), y, 20*eps);
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
122 %!assert (interpft (y', n), y', 20*eps);
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
123 %!assert (interpft ([y,y],n), [y,y], 20*eps);
5837
55404f3b0da1 [project @ 2006-06-01 19:05:31 by jwe]
jwe
parents:
diff changeset
124
20038
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19898
diff changeset
125 ## Test case with complex input from bug #39566
17173
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
126 %!test
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
127 %! x = (1 + j) * [1:4]';
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
128 %! y = ifft ([15 + 15*j; -6; -1.5 - 1.5*j; 0; -1.5 - 1.5*j; -6*j]);
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
129 %! assert (interpft (x, 6), y, 10*eps);
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
130
20038
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19898
diff changeset
131 ## Test for correct spectral symmetry with even/odd lengths
17287
011e5d67baf1 interpft.m: Widen tolerance on tests to allow for FFT error
Mike Miller <mtmiller@ieee.org>
parents: 17173
diff changeset
132 %!assert (max (abs (imag (interpft ([1:8], 20)))), 0, 20*eps);
011e5d67baf1 interpft.m: Widen tolerance on tests to allow for FFT error
Mike Miller <mtmiller@ieee.org>
parents: 17173
diff changeset
133 %!assert (max (abs (imag (interpft ([1:8], 21)))), 0, 21*eps);
011e5d67baf1 interpft.m: Widen tolerance on tests to allow for FFT error
Mike Miller <mtmiller@ieee.org>
parents: 17173
diff changeset
134 %!assert (max (abs (imag (interpft ([1:9], 20)))), 0, 20*eps);
011e5d67baf1 interpft.m: Widen tolerance on tests to allow for FFT error
Mike Miller <mtmiller@ieee.org>
parents: 17173
diff changeset
135 %!assert (max (abs (imag (interpft ([1:9], 21)))), 0, 21*eps);
17173
3a23cbde59d5 interpft.m: Fix interpolation to preserve spectral symmetry (bug #39566)
Mike Miller <mtmiller@ieee.org>
parents: 17089
diff changeset
136
20038
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19898
diff changeset
137 ## Test input validation
13768
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
138 %!error interpft ()
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
139 %!error interpft (1)
5f96b91b4e0c interpft.m: Miscellaneous code cleanup. Add more input validation tests.
Rik <octave@nomad.inbox5.com>
parents: 12676
diff changeset
140 %!error interpft (1,2,3)
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
141 %!error <N must be a scalar integer> interpft (1,[2,2])
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
142 %!error <N must be a scalar integer> interpft (1,2.1)
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
143 %!error <invalid dimension DIM> interpft (1,2,0)
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
144 %!error <invalid dimension DIM> interpft (1,2,3)
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
145