diff --git a/inst/kstest.m b/inst/kstest.m index 0153676b..25749c69 100644 --- a/inst/kstest.m +++ b/inst/kstest.m @@ -138,8 +138,8 @@ endif ## Remove NaNs, get sample size and compute empirical cdf x(isnan (x)) = []; - n = length(x); [sampleCDF, x] = ecdf (x); + n = length(x); ## Remove 1st element x = x(2:end); ## Check the hypothesized CDF specified under the null hypothesis. @@ -166,7 +166,7 @@ endif ## Remove duplicates. Check for consistency rd = find (diff (xCDF) == 0); - if (! isempty (rm)) + if (! isempty (rd)) if (! all (ydiff(rd) == 0)) error ("kstest: wrong duplicates in numericl CDF."); endif @@ -335,4 +335,3 @@ %! assert (p, 5.085438806199252e-05, 1e-14); %! assert (k, 0.2197, 1e-4); %! assert (c, 0.1207, 1e-4); -