# Retrieving a Matrix from a Matrix multiplication

I have made a matrix multiplication in Matlab (K, P and S are all 2x2 matrices):

K = P * transpose(H)*S


Now Im given K, P, and H. I need to know S. Given that matrix division is not defined, and that matrix multiplication is non-communitative, how do I do this? It looks simple, but I think it is not..

$S=(H^{T})^{-1}P^{-1}K$ where $A^{T}$ denotes the transpose of $A$, and $A^{-1}$ denotes the inverse. This works as $AA^{-1}$= identity matrix.