Mercurial > octave
view scripts/statistics/movmin.m @ 26247:86217421a37f
__parse_movargs__.m: Accept dimension and nanflag arguments.
* __parse_movargs__.m: Rewrite to accept both dimension and nanflag arguments
as both may be present simultaneously. Create a new first argument to the
function, caller, which is a string used in error messages so that the correct
function is identified as the source of the error. Add BIST tests for function.
* movmin.m: Call __parse_movargs__ with first argument of "movmin".
author | Rik <rik@octave.org> |
---|---|
date | Sun, 16 Dec 2018 13:53:54 -0800 |
parents | 58b3107a00bc |
children | f73ca7468864 |
line wrap: on
line source
## Copyright (C) 2018 Juan Pablo Carbajal ## ## This file is part of Octave. ## ## Octave is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <https://www.gnu.org/licenses/>. ## Author: Juan Pablo Carbajal <ajuanpi+dev@gmail.com> ## Created: 2018-08-13 ## -*- texinfo -*- ## @deftypefn {} {@var{y} =} movmin (@var{x}, @var{wlen}) ## @deftypefnx {} {@var{y} =} movmin (@var{x}, [@var{na}, @var{nb}]) ## @deftypefnx {} {@var{y} =} movmin (@dots{}, @var{dim}) ## @deftypefnx {} {@var{y} =} movmin (@dots{}, @var{nanstr}) ## @deftypefnx {} {@var{y} =} movmin (@dots{}, @var{property}, @var{value}) ## Minimum of @var{x} over a sliding window of length @var{wlen}. ## ## FIXME: Need explanation of all options. Write once and then replicate. ## ## @seealso{movfun} ## @end deftypefn function y = movmin (x, wlen, varargin) y = movfun (@min, x, wlen, __parse_movargs__ ("movmin", varargin{:}){:}); endfunction ## FIXME: Need BIST tests