I'm looking for an efficient way to construct the following matrix
where and are indexed from 0 to N as they would be in a base number system i.e. 000,001,…,00N,010,…,01N,…,0NN,…NNN. These indices are then 'split up' across the different functions . Written out this looks like
.
So, for example if then the final matrix is the following 27×27 matrix:
.
In practise N will probably be around 15 and the functions can be quite costly so ideally I'd like to implement a vectorised method.
Thanks in advance,
Andrew
Best Answer