I have a matrix outputs from my function in the following form;
zeros(3,5,5)
Basically, its a result of pairwise comparison of a matrix
(5 x 5)
for
3
different modalities (types).
I wish to convert this matrix with each pairwise comparison matrix separately with respect to different modalities.i.e I wish to have the result as below;
1 2 3i1 j1 k1i2 j2 k2i3 . .i4 . .i5 . .i6 . .. . .. . .. . .. . .i25 j25 k25
I checked the example using Reshape and could not get much from it. Can anyone please help me through? Thanks
Best Answer
The general reordering of elements can be done by:
In your case (perhaps - still not sure what "i1, j1, k1 etc" means):
If this is the wanted output, there is an abbreviation:
permute(Matrix, [2,1]) is the same as mtranspose() and the 2nd reshape is not required here. But it is worth to keep the general transformation in mind.