Reputation: 75
I need to add a new matrix to a previously existant matrix, but on his dimension coordinate. I know this is hard to understand, so let's see it on a example:
I've a matrix like this:
480x640x3
And I want to add the following one:
480x640x6
The result has be this: (6+3 = 9)
480x640x9
As you can see it adds but on the 3rd dimension.
Upvotes: 4
Views: 12952
Reputation: 1003
I would say that gnovice's answer is probably the best way to go, but you could do it this way too:
matrix1(:,:,4:9) = matrix2;
Upvotes: 5