Mercurial > repos > public > sbplib
comparison +blockmatrix/toMatrix.m @ 629:2b03ee11e48b feature/grids
Merge
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 20 Oct 2017 23:30:05 +0200 |
parents | 2501067f2fc7 |
children |
comparison
equal
deleted
inserted
replaced
628:0609a72dcdfe | 629:2b03ee11e48b |
---|---|
10 N = sum(n); | 10 N = sum(n); |
11 M = sum(m); | 11 M = sum(m); |
12 | 12 |
13 A = sparse(N,M); | 13 A = sparse(N,M); |
14 | 14 |
15 n_ind = [0 cumsum(n)]; | |
16 m_ind = [0 cumsum(m)]; | |
17 | |
18 for i = 1:size(bm,1) | 15 for i = 1:size(bm,1) |
19 for j = 1:size(bm,2) | 16 for j = 1:size(bm,2) |
20 if(isempty(bm{i,j})) | 17 if isempty(bm{i,j}) |
21 bm{i,j} = sparse(n(i),m(j)); | 18 bm{i,j} = sparse(n(i),m(j)); |
22 end | 19 end |
23 end | 20 end |
24 end | 21 end |
25 A = cell2mat(bm); | 22 A = cell2mat(bm); |