function [p,anovatab,stats] = kruskalwallis(varargin)
%KRUSKALWALLIS Nonparametric one-way analysis of variance (ANOVA).
%   KRUSKALWALLIS performs a non-parametric one-way ANOVA for
%   comparing the medians or means of two or more groups of data. It
%   returns the p-value for the null hypothesis that the medians of
%   the groups are equal.
%
%   P = KRUSKALWALLIS(X,GROUP,DISPLAYOPT)
%   If X is a matrix, KRUSKALWALLIS treats each column as a separate
%     group, and determines whether the population medians of the
%     columns are equal.  This form of input is appropriate when
%     each group has the same number of elements (balanced).
%     GROUP can be a character array or a cell array of strings,
%     with one row per column of X, containing the group names.
%     Enter an empty array ([]) or omit this argument if you do not
%     want to specify group names.
%   If X is a vector, GROUP must be a vector of the same length, or a
%     string array or cell array of strings with one row for each
%     element of X.  X values corresponding to the same value of
%     GROUP are placed in the same group.
%
%   DISPLAYOPT can be 'on' (the default) to display figures
%   containing a boxplot and the Kruskal-Wallis version of a
%   one-way anova table, or 'off' to omit these displays.
%
%   [P,ANOVATAB] = KRUSKALWALLIS(...) returns the ANOVA table values
%   as the cell array ANOVATAB.
%
%   [P,ANOVATAB,STATS] = KRUSKALWALLIS(...) returns an additional
%   structure of statistics useful for performing a multiple
%   comparison of means with the MULTCOMPARE function.
%
%   See also ANOVA1, MULTCOMPARE.

%   Reference: M. Hollander and D.A. Wolfe, "Nonparametric
%   Statistical Methods," 1973, Wiley, New York.

%   Copyright 1993-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $  $Date: 2000/05/26 18:52:59 $

error(nargchk(1,3,nargin));
[p,anovatab0,stats0] = anova1('kruskalwallis', varargin{:});
if (nargout > 1), anovatab = anovatab0; end
if (nargout > 2), stats = stats0; end
