I have the following equation I came across which was solved using least squares
$x = \sum_{n=1}^{N} A_{n} y_{n}$
Where $x$ is a $m \times p$ matrix and $y$ would be of size $m \times p$ as well ,where $p=N$.Both $x$ and $y$ are known. $A_n$ are the weights to be computed for every $y_{n}$.
How would one do a least squares approximation to solve for $A_n$ so that there would be only 1 value of $A_n$ for every column in $y$? Usually least squares (in MATLAB) requires a matrix and a column vector, but in this case there are 2 matrices. Is there any standard technique I am missing here?