matrix ouput