|
From: William P. Y. H. <wil...@gm...> - 2005-12-08 13:32:14
|
The blkdiag.m file I imported into Octave is dependent on cell2mat,
but I think it's not quite ready for inclusion into Octave yet. So I
modified the file (attached). Maybe the original author (Laurent
Mazet) and others would like to comment on it before I post it on
bu...@oc...?
Due to my lack of intelligence, I've so far failed to completely
understand the following code by Laurent (hey, but it works!) (it's
been reformatted):
for p =3D (ndims (c)):-1:2,
sz =3D size (c);
sz(end) =3D 1;
c1 =3D cell (sz);
for q =3D 1:(prod (sz))
c1{q} =3D cat (p, c{q:(prod (sz)):end});
endfor
c =3D c1;
endfor
m =3D cat (1, c1{:});
Can anyone explain it to me?
Note: I changed the wording of the license from "this program" to
"Octave". Is it OK?
--
William Poetra Yoga Hadisoeseno
|