repo.or.cz
/
wrf-fire-matlab.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
ts_smoke.py runs
[wrf-fire-matlab.git]
/
quicwind
/
cell2vec.m
blob
e1b0e6eebdcfe7d966396d038db467171b36c7dc
1
function v=cell2vec(c)
2
% v=cell2vec(c)
3
% Flatten a cell array of matrices to a vector
4
5
[m,n]=size(c);
6
v=[];
7
t=sum(sum(cellfun(@numel,c)));
8
v=zeros(t,1);
9
k=0;
10
for j=1:n
11
for i=1:m
12
s = size(c{i,j});
13
e = prod(s);
14
v(k+1:k+e)=reshape(c{i,j},[e,1]);
15
k=k+e;
16
end
17
end
18
if t~=k,
19
error('internal')
20
end
21
end