I'm doing some kind of research, and the multidimensional version of what I'm doing involves taking the $\arctan$ function of a strictly real square matrix. The matrix is not guaranteed to be invertible, and if the $\arctan$ is complex the matter becomes much more complicated. I checked Wikipedia but could not find any necessary and sufficient conditions. So, I'm asking here.
The matrix I'm trying to apply $\arctan$ to is one with arbitrary elements, and it would be good if the $\arctan$ I'm looking for is continuous w.r.t. the parameters (at least when they're real), so I'm asking it here too - is there a branch of $\arctan$, of a square matrix whose elements are in the reals, that is continuous w.r.t. the elements (or differentiable/smooth etc if any)?
P.S. I've done some calculations by myself- from Sylvester's formula, it seems that a strictly real square matrix has a strictly real arctan if (but not necessarily only if) none of its eigenvalues are $i$ or $-i$. A real matrix always has conjugate eigenvalues, so what I'm wondering here is actually just this- even if the given matrix has $\pm i$ as eigenvalues, the infinity of arctan at eigenvalue +i and the infinity of arctan at eigenvalue $-i$ could maybe cancel out, leaving only a real, finite number behind.
EDIT: I have found out a way to circumvent it during research, but thank you for the answers!