In Octave/Matlab I can expand an identity matrix as follows.
>> I = eye(3)
I =
Diagonal Matrix
1 0 0
0 1 0
0 0 1
>> A = [ 3 2 3 2 2 1 3 2 2 1 ]
>> E = I(:, A)
E =
0 0 0 0 0 1 0 0 0 1
0 1 0 1 1 0 0 1 1 0
1 0 1 0 0 0 1 0 0 0
How can I achieve the same thing (i.e. obtain E from A, possibly using I) with Scala/Breeze ?
Got it. Actually very similar to Octave.
The caveats are: