diff --git a/__all_stat_opts__.m b/__all_stat_opts__.m index a78a86e..6f90fee 100644 --- a/__all_stat_opts__.m +++ b/__all_stat_opts__.m @@ -1,17 +1,17 @@ ## Copyright (C) 2009-2015 VZLU Prague ## -## Octave is free software; you can redistribute it and/or modify it +## This function 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 +## This function 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 +## along with this function; see the file COPYING. If not, see ## . ## -*- texinfo -*- @@ -23,7 +23,6 @@ ## list of possible values. ## ## Copied from Octave (was '__all_opts__') (Asma Afzal ). -## @end deftypefn function names = __all_stat_opts__ (varargin) diff --git a/statget.m b/statget.m index e9a6043..044d4c5 100644 --- a/statget.m +++ b/statget.m @@ -1,18 +1,18 @@ ## Copyright (C) 2008-2015 Jaroslav Hajek ## Copyright (C) 2009 VZLU Prague ## -## Octave is free software; you can redistribute it and/or modify it +## This function 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 +## This function 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 +## along with this function; see the file COPYING. If not, see ## . ## -*- texinfo -*- @@ -24,9 +24,11 @@ ## If @var{parname} is not defined then return @var{default} if supplied, ## otherwise return an empty matrix. ## -## Copied from Octave (was 'optimget') (Asma Afzal ). +## @seealso{statset} ## @end deftypefn +## Copied from Octave (was 'optimset') (Asma Afzal ). + function retval = statget (options, parname, default) if (nargin < 2 || nargin > 4 || ! isstruct (options) || ! ischar (parname)) @@ -41,7 +43,7 @@ function retval = statget (options, parname, default) if (nmatch == 1) parname = opts{idx}; - elseif + elseif (nmatch == 0) warning ("statget: unrecognized option: %s", parname); else fmt = sprintf ("statget: ambiguous option: %%s (%s%%s)", diff --git a/statset.m b/statset.m index 563f67e..234e9f6 100644 --- a/statset.m +++ b/statset.m @@ -1,18 +1,18 @@ ## Copyright (C) 2007-2015 John W. Eaton ## Copyright (C) 2009 VZLU Prague ## -## Octave is free software; you can redistribute it and/or modify it +## This function 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 +## This function 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 +## along with this function; see the file COPYING. If not, see ## . ## -*- texinfo -*- @@ -23,11 +23,24 @@ ## @deftypefnx {Function File} address@hidden =} statset (@var{old}, @var{new}) ## Create options structure for statistics functions. ## -## Please see individual database functions for valid settings. +## When called without any input or output arguments, @code{statset} prints +## a list of all valid statistics parameters. ## -## Copied from Octave (was 'optimset') (Asma Afzal ). +## When called with one output and no inputs, return an options structure with +## all valid option parameters initialized to @code{[]}. +## +## When called with a list of parameter/value pairs, return an options +## structure with only the named parameters initialized. +## +## When the first input is an existing options structure @var{old}, the values +## are updated from either the @var{par}/@var{val} list or from the options +## structure @var{new}. +## +## Please see individual statistics functions for valid settings. ## @end deftypefn +## Copied from Octave (was 'optimset') (Asma Afzal ). + function retval = statset (varargin) nargs = nargin (); @@ -68,13 +81,12 @@ function retval = statset (varargin) ## Validate option. if (nmatch == 1) key = opts{find (i)}; - ## Use correct case. elseif (nmatch == 0) warning ("statset: unrecognized option: %s", key); else fmt = sprintf ("statset: ambiguous option: %%s (%s%%s)", repmat ("%s, ", 1, nmatch-1)); - warning (fmt, key, opts{i}); + warning (fmt, key, opts{i}); endif endif old.(key) = val;