Update matrix.php

Adding dot product. I don't really like the implementation though.