changeset 9702:cee6027d95a8 octave-forge

combnk: fixed bug due to changes (probably bug fix) in octave-core. Handle cell input correctly
author carandraug
date Wed, 14 Mar 2012 22:44:06 +0000
parents b4dccb6ed82d
children 0253d5aba9a2
files main/statistics/NEWS main/statistics/inst/combnk.m
diffstat 2 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/main/statistics/NEWS	Wed Mar 14 22:29:00 2012 +0000
+++ b/main/statistics/NEWS	Wed Mar 14 22:44:06 2012 +0000
@@ -5,9 +5,9 @@
 
       monotone_smooth kmeans jackknife
 
- ** Bug fixes on the function:
+ ** Bug fixes on the functions:
 
-      normalise_distribution
+      normalise_distribution  combnk
       repanova
 
  ** The following functions were removed since equivalents are now
--- a/main/statistics/inst/combnk.m	Wed Mar 14 22:29:00 2012 +0000
+++ b/main/statistics/inst/combnk.m	Wed Mar 14 22:44:06 2012 +0000
@@ -1,17 +1,17 @@
-## Copyright (C) 2010  Soren Hauberg
+## Copyright (C) 2010 Soren Hauberg <soren@hauberg.org>
 ##
-## This program 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.
+## This program 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.
 ##
-## This program 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.
+## This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+## You should have received a copy of the GNU General Public License along with
+## this program; if not, see <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {@var{c} =} combnk (@var{data}, @var{k})
@@ -51,7 +51,11 @@
   else
     ## Process data
     n = numel (data);
-    retval = [];
+    if iscell (data)
+      retval = {};
+    else
+      retval = [];
+    endif
     for j = 1:n
       C = __combnk__ (data ((j+1):end), k-1);
       C = cat (2, repmat (data (j), rows (C), 1), C);