Matrix slicing and conversion