3d to 2d matrix
3 views (last 30 days)
I have an [r c w] matrix where r & c are the pixels of a hyperspectral picture and the w are the number of layers of the picture.
I want to turn this matrix to [w , x] matrix.
For example. I want the values of w for the pixel 1,1 below 1. and the values of w of the pixel 1,2 below 2 until the whole table is finished.
I thought of the following commands but I'm not sure if it works because my matrix is massive.
Björn on 15 Oct 2012
Edited: Björn on 15 Oct 2012
This might do the trick:
You first convert it to a [1,r*c,w] matrix. After this you convert it to a [r*c,w] matrix and taking the transpose resulting in an [w,r*c] array with the values you wanted.