Matlab Code that orients the pixel matrix appropriately.

Changed David's Matlab code to orient the pixels correctly.