How can one find solutions to the set of (polynomial) matrix inequalities $$M \succ 0,\quad A_i^TMA_i \preceq c\cdot M,\quad\forall i=1,\dots,m$$ where $M=M^T\in\mathbb{R}^{n\times n}$ and $A_i \in\mathbb{R}^{n\times n}$ and $c\in(0,1)$ is a constant?
Remark: If the matrices $A_i$ are known and $c$ is fixed, the above conditions become LMIs and one can check if an appropriate $M$ can be found. The matrices $A_i$ do not have to be symmetric. As an example, given $$A_{1} = \begin{pmatrix} -0.2694 & 0.2820 \\ -0.3521 & -0.3555 \end{pmatrix},\quad A_{2} = \begin{pmatrix} -0.0853 & -0.2789\\ 0.1978 & -0.3814 \end{pmatrix}$$and $c=0.5$ one can find $$M = \begin{pmatrix} 2.9647 & -0.0338\\ -0.0338 & 3.0563 \end{pmatrix}$$ using YALMIP / SeDuMi.
However, I would actually like to optimize over parameters of the matrices $A_i$ according to a cost function, subject to the condition above (i.e. $M$ is not known and only any particular one needs to be found; $c=0.99$ can be taken initially). The number $m$ of matrices $A_i$ can be fixed a priori. I usually have $m\in\{3,4,5\}$ and $n=2$ or $n=6$. Currently, the optimization is done without the constraint above, which is checked afterwards.
Is there a way to optimize over $A_i$ and simultaneously make sure any $M$ exists such that the inequalities hold?