comparison 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
comparison
equal deleted inserted replaced
72:942cb3c53a47 73:a5fa3c2d0aa3
1 function A = cell2sparse(C) 1 function A = cell2sparse(C)
2
3 if isempty(C)
4 A = sparse([]);
5 return
6 end
7
2 n = row_height(C); 8 n = row_height(C);
3 m = col_width(C); 9 m = col_width(C);
4 10
5 N = sum(n); 11 N = sum(n);
6 M = sum(m); 12 M = sum(m);