In reply to Milla.

Same answer, but then apply the transpose operator Y=T(Y);
You might also be interested in the ideas in this article about converting subscripts to indices.