annotate scripts/statistics/movmin.m @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
1 ## Copyright (C) 2018-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27567
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27567
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27567
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27567
diff changeset
5 ##
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
6 ##
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
7 ## This file is part of Octave.
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
8 ##
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
10 ## under the terms of the GNU General Public License as published by
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
12 ## (at your option) any later version.
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
13 ##
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
17 ## GNU General Public License for more details.
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
18 ##
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
21 ## <https://www.gnu.org/licenses/>.
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
22
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
23 ## -*- texinfo -*-
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
24 ## @deftypefn {} {@var{y} =} movmin (@var{x}, @var{wlen})
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
25 ## @deftypefnx {} {@var{y} =} movmin (@var{x}, [@var{na}, @var{nb}])
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
26 ## @deftypefnx {} {@var{y} =} movmin (@dots{}, @var{dim})
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
27 ## @deftypefnx {} {@var{y} =} movmin (@dots{}, "@var{nancond}")
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
28 ## @deftypefnx {} {@var{y} =} movmin (@dots{}, @var{property}, @var{value})
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
29 ## Calculate the moving minimum over a sliding window of length @var{wlen} on
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
30 ## data @var{x}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
31 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
32 ## If @var{wlen} is a scalar, the function @code{min} is applied to a
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
33 ## 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: 26247
diff changeset
34 ## 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: 26247
diff changeset
35 ## either side of the central element. For example, when calculating the
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
36 ## output at index 5 with a window length of 3, @code{movmin} uses data
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
37 ## 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: 26247
diff changeset
38 ## 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: 26247
diff changeset
39 ## 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: 26247
diff changeset
40 ## 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: 26247
diff changeset
41 ## window length of 4, @code{movmin} uses data elements
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
42 ## @w{@code{[3, 4, 5, 6]}}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
43 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
44 ## 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: 26247
diff changeset
45 ## 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: 26247
diff changeset
46 ## window includes @var{nb} number of elements @emph{before} the current
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
47 ## 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: 26247
diff changeset
48 ## The current element is always included. For example, given
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
49 ## @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: 26247
diff changeset
50 ## @w{@code{[2, 3, 4, 5]}}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
51 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
52 ## 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: 26247
diff changeset
53 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
54 ## The optional string argument @qcode{"@var{nancond}"} controls whether
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
55 ## @code{NaN} and @code{NA} values should be included (@qcode{"includenan"}),
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
56 ## or excluded (@qcode{"omitnan"}), from the data passed to @code{min}. The
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
57 ## default is @qcode{"includenan"}. Caution: the @qcode{"omitnan"} option is
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
58 ## not yet implemented.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
59 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
60 ## The calculation can be controlled by specifying @var{property}/@var{value}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
61 ## pairs. Valid properties are
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
62 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
63 ## @table @asis
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
64 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
65 ## @item @qcode{"Endpoints"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
66 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
67 ## This property controls how results are calculated at the boundaries
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
68 ## (@w{endpoints}) of the window. Possible values are:
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
69 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
70 ## @table @asis
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
71 ## @item @qcode{"shrink"} (default)
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
72 ## 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: 26247
diff changeset
73 ## 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: 26247
diff changeset
74 ## length 3, @code{@var{y}(1) = min (@var{x}(1:2))}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
75 ## @code{@var{y}(end) = min (@var{x}(end-1:end))}.
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
76 ##
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
77 ## @item @qcode{"discard"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
78 ## 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: 26247
diff changeset
79 ## 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: 26247
diff changeset
80 ## 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: 26247
diff changeset
81 ## element would require calculating the function over indices
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
82 ## @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: 26247
diff changeset
83 ## 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: 26247
diff changeset
84 ## therefore discarded.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
85 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
86 ## @item @qcode{"fill"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
87 ## 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: 26247
diff changeset
88 ## example, with a window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
89 ## @code{@var{y}(1) = min ([NaN, @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
90 ## @code{@var{y}(end) = min ([@var{x}(end-1:end), NaN])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
91 ## 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: 26247
diff changeset
92 ## boundaries, although it is influenced by how @code{min} handles @code{NaN},
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
93 ## and also by the property @qcode{"nancond"}.
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
94 ##
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
95 ## @item @var{user_value}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
96 ## 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: 26247
diff changeset
97 ## 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: 26247
diff changeset
98 ## window of length 3,
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
99 ## @code{@var{y}(1) = min ([@var{user_value}, @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
100 ## @code{@var{y}(end) = min ([@var{x}(end-1:end), @var{user_value}])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
101 ## A common choice for @var{user_value} is 0.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
102 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
103 ## @item @qcode{"same"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
104 ## 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: 26247
diff changeset
105 ## @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: 26247
diff changeset
106 ## @code{@var{y}(1) = min ([@var{x}(1), @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
107 ## @code{@var{y}(end) = min ([@var{x}(end-1:end), @var{x}(end)])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
108 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
109 ## @item @qcode{"periodic"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
110 ## 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: 26247
diff changeset
111 ## 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: 26247
diff changeset
112 ## @code{@var{y}(1) = min ([@var{x}(end), @var{x}(1:2)])}, and
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
113 ## @code{@var{y}(end) = min ([@var{x}(end-1:end), @var{x}(1)])}.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
114 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
115 ## @end table
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
116 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
117 ## @item @qcode{"SamplePoints"}
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
118 ## Caution: This option is not yet implemented.
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
119 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
120 ## @end table
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
121 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
122 ## 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: 26671
diff changeset
123 ## For additional options and documentation, @pxref{XREFmovfun,,movfun}.
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
124 ##
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
125 ## @seealso{movfun, movslice, movmad, movmax, movmean, movmedian, movprod, movstd, movsum, movvar}
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
126 ## @end deftypefn
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
127
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
128 function y = movmin (x, wlen, varargin)
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
129
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
130 if (nargin < 2)
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
131 print_usage ();
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
132 endif
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
133
26671
12b6065efa25 Improve performance of certain movXXX functions by ~4X (bug #55389).
Rik <rik@octave.org>
parents: 26587
diff changeset
134 y = movfun (@min, x, wlen, "Endpoints", Inf,
12b6065efa25 Improve performance of certain movXXX functions by ~4X (bug #55389).
Rik <rik@octave.org>
parents: 26587
diff changeset
135 __parse_movargs__ ("movmin", varargin{:}){:});
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
136
26244
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
137 endfunction
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
138
58b3107a00bc Update documentation for movXXX functions (bug #48774).
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
diff changeset
139
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
140 ## 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
141 # test for bug #55241
895f2f609a96 movXXX.m: bug #55241. Add simple test
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 26262
diff changeset
142 %!assert ([1; (1:9).'], movmin ((1:10).', 3))
26262
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
143
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
144 ## Test input validation
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
145 %!error movmin ()
f73ca7468864 Add movXXX moving statistical functions bug #48774).
Rik <rik@octave.org>
parents: 26247
diff changeset
146 %!error movmin (1)