Adds function to get the Y-matrix

Written by Yangxue
Small fix in getLabelMatrixY

* Reorders for-loops to recreate vectorising schema of Matlab (columns
first).
* Fixes indexing in Y.