changeset 9788:e3e5d43d9d4c

fix arrayfun with nargout=0
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 09 Nov 2009 08:59:28 +0100
parents cc5bb7b5679f
children 97f5de91427b
files scripts/ChangeLog scripts/general/arrayfun.m
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Nov 09 12:42:24 2009 -0500
+++ b/scripts/ChangeLog	Mon Nov 09 08:59:28 2009 +0100
@@ -1,3 +1,7 @@
+2009-11-09  Jaroslav Hajek  <highegg@gmail.com>
+
+	* general/arrayfun.m: Fix nargout=0 case.
+
 2009-11-08  Petr Mikulik <mikulik@physics.muni.cz>
 
 	* plot/gnuplot_drawnow.m: Support gnuplot's dumb terminal.
--- a/scripts/general/arrayfun.m	Mon Nov 09 12:42:24 2009 -0500
+++ b/scripts/general/arrayfun.m	Mon Nov 09 08:59:28 2009 +0100
@@ -156,7 +156,7 @@
   args = cellfun (@num2cell, args, "UniformOutput", false,
   "ErrorHandler",  @arg_class_error);
 
-  [varargout{1:nargout}] = cellfun (func, args{:}, opts{:});
+  [varargout{1:max(1, nargout)}] = cellfun (func, args{:}, opts{:});
 
 endfunction