# Matrix with zero spectral radius

I need an algorithm which generates a random matrix with spectral radius equal zero.

The only solution I have so far is to generate two vectors $$v,w$$, normal onto each other ($$v\perp w$$), and then take the product $$vw^T$$. But this is numerically not very stable, and the resulting matrices have spectral radii in the order of $$10^{-6}$$ for matrices of size $$\sim15$$.

• Are there any other requirements? One way is to just generate a random number for each matrix entry $A_{ij}$ where $i < j$. Then the matrix is upper-triangular and its diagonals are all zero, so it has spectral radius zero. – Zach Langley Dec 11 '18 at 20:53