I have several real symmetric matrices, say, $A_1, A_2,\dots, A_n$. I want to know if there exists a complex linear combination of these matrices
$$M := \sum_{i=1}^n c_i A_i , \quad c_i \in \mathbb{C}$$
satisfying $\text{rank}(M)\leq2$. If there are such $c_i$'s, what are they? Is there any method of doing this?