In a Perl script I'm working on, I need to build a matrix out of several other matrices. I've looked at a couple of modules in CPAN (Math::Matrix, PDL::Matrix, Math::Cephes::Matrix), but none of these seem to support this.
In Octave, this is very easy. Here's an example of something similar to what I'm trying to do:
octave:1> A = [ 1, 2; 3, 4 ]
A =
1 2
3 4
octave:2> B = [ 5, 6; 7, 8 ]
B =
5 6
7 8
octave:3> C = [ 9, 10; 11, 12 ]
C =
9 10
11 12
octave:4> D = [ 13, 14; 15, 16 ]
D =
13 14
15 16
octave:5> E = [ A, B; C, D ]
E =
1 2 5 6
3 4 7 8
9 10 13 14
11 12 15 16
It seems trying to do this myself would get messy kinda quickly, which is probably why these modules don't support it... Has anyone else out there ever had a need for this? Have you solved it?