changeset 11849:74802398931b release-3-0-x

fix blkdiag to not rely on Matlab-incompatible behaviour
author Jaroslav Hajek <highegg@gmail.com>
date Sun, 21 Sep 2008 08:21:52 +0200
parents 79d5312ab8e6
children f25094e43897
files scripts/ChangeLog scripts/general/blkdiag.m
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-18  Jaroslav Hajek <highegg@gmail.com>
+
+	* general/blkdiag.m: Skip assignment if rhs is empty.
+
 2008-09-18  Kris Thielemans  <kris.thielemans@csc.mrc.ac.uk>
 
 	* image/imshow.m: Fix for display_range.
--- a/scripts/general/blkdiag.m
+++ b/scripts/general/blkdiag.m
@@ -49,7 +49,10 @@
   retval = zeros (csz(end,:));
 
   for p = 1:nargin
-    retval((csz(p,1)+1):csz(p+1,1),(csz(p,2)+1):csz(p+1,2)) = varargin{p};
+    vp = varargin{p};
+    if (! isempty (vp))
+      retval((csz(p,1)+1):csz(p+1,1),(csz(p,2)+1):csz(p+1,2)) = vp;
+    endif
   endfor
 
 endfunction