Change types from Array to Matrix/Vector