annotate scripts/statistics/movmad.m @ 27567:51c2e46e9a36

doc: Tweaks to @ref, @xref, @pxref invocations for better output. * open.m: Don't use spaces for empty arguments to @xref. Add @code{} around function name hgload. * camorbit.m, camup.m: Use @ref rather than @pxref to avoid generating 'see '. * movmad.m, movmax.m, movmean.m, movmedian.m, movmin.m, movprod.m, movstd.m, movsum.m, movvar.m: Use @pxref rather than @xref to generate lowercase 'see'.
author Rik <rik@octave.org>
date Sat, 26 Oct 2019 05:56:52 -0700
parents 00f796120a6d
children b442ec6dda5c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26376
00f796120a6d maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents: 26266
diff changeset
1 ## Copyright (C) 2018-2019 Rik Wehbring
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
2 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
4 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
5 ## Octave is free software: you can redistribute it and/or modify it
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation, either version 3 of the License, or
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
8 ## (at your option) any later version.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
9 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
13 ## GNU General Public License for more details.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
14 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
17 ## <https://www.gnu.org/licenses/>.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
18
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
20 ## @deftypefn {} {@var{y} =} movmad (@var{x}, @var{wlen})
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
21 ## @deftypefnx {} {@var{y} =} movmad (@var{x}, [@var{na}, @var{nb}])
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
22 ## @deftypefnx {} {@var{y} =} movmad (@dots{}, @var{dim})
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
23 ## @deftypefnx {} {@var{y} =} movmad (@dots{}, "@var{nancond}")
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
24 ## @deftypefnx {} {@var{y} =} movmad (@dots{}, @var{property}, @var{value})
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
25 ## Calculate the moving mean absolute deviation over a sliding window of length
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
26 ## @var{wlen} on data @var{x}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
27 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
28 ## If @var{wlen} is a scalar, the function @code{mad} is applied to a
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
29 ## moving window of length @var{wlen}. When @var{wlen} is an odd number the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
30 ## window is symmetric and includes @w{@code{(@var{wlen} - 1) / 2}} elements on
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
31 ## either side of the central element. For example, when calculating the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
32 ## output at index 5 with a window length of 3, @code{movmad} uses data
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
33 ## elements @w{@code{[4, 5, 6]}}. If @var{wlen} is an even number, the window
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
34 ## is asymmetric and has @w{@code{@var{wlen}/2}} elements to the left of the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
35 ## central element and @w{@code{@var{wlen}/2 - 1}} elements to the right of the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
36 ## central element. For example, when calculating the output at index 5 with a
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
37 ## window length of 4, @code{movmad} uses data elements
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
38 ## @w{@code{[3, 4, 5, 6]}}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
39 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
40 ## If @var{wlen} is an array with two elements @w{@code{[@var{nb}, @var{na}]}},
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
41 ## the function is applied to a moving window @code{-@var{nb}:@var{na}}. This
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
42 ## window includes @var{nb} number of elements @emph{before} the current
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
43 ## element and @var{na} number of elements @emph{after} the current element.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
44 ## The current element is always included. For example, given
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
45 ## @w{@code{@var{wlen} = [3, 0]}}, the data used to calculate index 5 is
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
46 ## @w{@code{[2, 3, 4, 5]}}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
47 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
48 ## If the optional argument @var{dim} is given, operate along this dimension.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
49 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
50 ## The optional string argument @qcode{"@var{nancond}"} controls whether
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
51 ## @code{NaN} and @code{NA} values should be included (@qcode{"includenan"}),
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
52 ## or excluded (@qcode{"omitnan"}), from the data passed to @code{mad}. The
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
53 ## default is @qcode{"includenan"}. Caution: the @qcode{"omitnan"} option is
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
54 ## not yet implemented.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
55 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
56 ## The calculation can be controlled by specifying @var{property}/@var{value}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
57 ## pairs. Valid properties are
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
58 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
59 ## @table @asis
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
60 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
61 ## @item @qcode{"Endpoints"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
62 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
63 ## This property controls how results are calculated at the boundaries
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
64 ## (@w{endpoints}) of the window. Possible values are:
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
65 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
66 ## @table @asis
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
67 ## @item @qcode{"shrink"} (default)
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
68 ## The window is truncated at the beginning and end of the array to exclude
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
69 ## elements for which there is no source data. For example, with a window of
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
70 ## length 3, @code{@var{y}(1) = mad (@var{x}(1:2))}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
71 ## @code{@var{y}(end) = mad (@var{x}(end-1:end))}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
72 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
73 ## @item @qcode{"discard"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
74 ## Any @var{y} values that use a window extending beyond the original
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
75 ## data array are deleted. For example, with a 10-element data vector and a
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
76 ## window of length 3, the output will contain only 8 elements. The first
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
77 ## element would require calculating the function over indices
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
78 ## @w{@code{[0, 1, 2]}} and is therefore discarded. The last element would
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
79 ## require calculating the function over indices @w{@code{[9, 10, 11]}} and is
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
80 ## therefore discarded.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
81 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
82 ## @item @qcode{"fill"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
83 ## Any window elements outside the data array are replaced by @code{NaN}. For
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
84 ## example, with a window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
85 ## @code{@var{y}(1) = mad ([NaN, @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
86 ## @code{@var{y}(end) = mad ([@var{x}(end-1:end), NaN])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
87 ## This option usually results in @var{y} having @code{NaN} values at the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
88 ## boundaries, although it is influenced by how @code{mad} handles @code{NaN},
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
89 ## and also by the property @qcode{"nancond"}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
90 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
91 ## @item @var{user_value}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
92 ## Any window elements outside the data array are replaced by the specified
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
93 ## value @var{user_value} which must be a numeric scalar. For example, with a
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
94 ## window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
95 ## @code{@var{y}(1) = mad ([@var{user_value}, @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
96 ## @code{@var{y}(end) = mad ([@var{x}(end-1:end), @var{user_value}])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
97 ## A common choice for @var{user_value} is 0.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
98 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
99 ## @item @qcode{"same"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
100 ## Any window elements outside the data array are replaced by the value of
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
101 ## @var{x} at the boundary. For example, with a window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
102 ## @code{@var{y}(1) = mad ([@var{x}(1), @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
103 ## @code{@var{y}(end) = mad ([@var{x}(end-1:end), @var{x}(end)])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
104 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
105 ## @item @qcode{"periodic"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
106 ## The window is wrapped so that any missing data elements are taken from
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
107 ## the other side of the data. For example, with a window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
108 ## @code{@var{y}(1) = mad ([@var{x}(end), @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
109 ## @code{@var{y}(end) = mad ([@var{x}(end-1:end), @var{x}(1)])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
110 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
111 ## @end table
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
112 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
113 ## @item @qcode{"SamplePoints"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
114 ## Caution: This option is not yet implemented.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
115 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
116 ## @end table
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
117 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
118 ## Programming Note: This function is a wrapper which calls @code{movfun}.
27567
51c2e46e9a36 doc: Tweaks to @ref, @xref, @pxref invocations for better output.
Rik <rik@octave.org>
parents: 26376
diff changeset
119 ## For additional options and documentation, @pxref{XREFmovfun,,movfun}.
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
120 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
121 ## @seealso{movfun, movslice, movmax, movmean, movmedian, movmin, movprod, movstd, movsum, movvar}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
122 ## @end deftypefn
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
123
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
124 function y = movmad (x, wlen, varargin)
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
125
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
126 if (nargin < 2)
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
127 print_usage ();
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
128 endif
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
129
26266
895f2f609a96 movXXX.m: bug #55241. Add simple test
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 26262
diff changeset
130 y = movfun (@mad, x, wlen, __parse_movargs__ ("movmad", varargin{:}){:});
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
131
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
132 endfunction
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
133
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
134
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
135 ## FIXME: Need functional BIST tests
26266
895f2f609a96 movXXX.m: bug #55241. Add simple test
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 26262
diff changeset
136 # test for bug #55241
895f2f609a96 movXXX.m: bug #55241. Add simple test
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 26262
diff changeset
137 %!assert ([0.5; repmat(2/3,8,1); 0.5], movmad ((1:10).', 3))
895f2f609a96 movXXX.m: bug #55241. Add simple test
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 26262
diff changeset
138
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
139
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
140 ## Test input validation
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
141 %!error movmad ()
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents:
diff changeset
142 %!error movmad (1)