I am writing a code on Matlab to calculate the matrix $B$, given $C$ and $A$, following the equation
$$C=A B A^\mathrm{T}$$
$A^\mathrm{T}$ is non-invertible, so I can't just multiply $C$ by the inverse of the matrices.
I can't solve this by hand either because $C$ is a $3144×3144$ matrix...any help will be greatly appreciated!
For $A(N\times K)$ and $rank(A)=K \leq N$ we have $$B = (A^TA)^{-1}A^TCA(A^TA)^{-1}. $$