diff cell2sparse.m @ 73:a5fa3c2d0aa3

Fixed problem with cell2sparse for empty matrices.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 23 Nov 2015 15:48:58 +0100
parents 48b6fb693025
children
line wrap: on
line diff
--- a/cell2sparse.m	Mon Nov 23 14:55:58 2015 +0100
+++ b/cell2sparse.m	Mon Nov 23 15:48:58 2015 +0100
@@ -1,4 +1,10 @@
 function A = cell2sparse(C)
+
+    if isempty(C)
+        A = sparse([]);
+        return
+    end
+
     n = row_height(C);
     m = col_width(C);