I have a mxn matrix A that is transformed in some way to formulate B. The transformation can either be simple rotation or some other combination of transformations like flipud(rot(A,90)) etc. I am looking for some way to track the indices of A after any such transformation.
For Example
A = [1 2 3; 4 5 6; 7 8 9]
B = rot(A,90) = [3 6 9;2 5 8;1 4 7]
Original_Index = [1 1;1 2;1 3;2 1;2 2;2 3;3 1;3 2;3 2] (Orginal_Index is a 9×2 matrix that contains the row col indices of entries of A in Row Raster manner)
Transformed_Index = [3 1;2 1;1 1;3 2;2 2;1 2;3 3;2 3;1 3] (Also a 9×2 matrix which stores the row col indices of the entries after transformation)
I would appreciate any help in this regard.
Best Answer