Matrix construction from base n indices
Show older comments
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 27x27 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
1 Comment
Jan
on 12 Dec 2018
If the computation of f,g,h is costly, the vectorization of the creation of the matrix is not the main problem, but vectorize f,g,h.
Accepted Answer
More Answers (0)
Categories
Find more on Multidimensional Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!