I would like to store an array of different sparse matrices into a single matrix, something like this:
A(:,:,1) = sparse([0 0 1; 0 1 0]);
A(:,:,2) = sparse([0 0 1; 0 0 0]);
A(:,:,3) = sparse([1 0 1; 0 0 0]);
A(:,:,4) = sparse([0 0 1; 0 1 0]);
But, I get the error:
N-dimensional indexing allowed for Full matrices only.
It seems like others have ran into this problem: https://www.mathworks.com/matlabcentral/newsreader/view_thread/276098
but the link to the "bug fix" was broken and I am not sure how to deal with this issue. I know that I could use cell arrays but I know that they are slow and I am trying to avoid them. I guess that I could also use the full() command, but I am not sure if that is the best (fastest) way.
Any ideas?