MATLABs `sprandsym` in Julia

FWIW, another (orthogonal) idea based on How to generate random symmetric positive definite matrices using MATLAB? - Mathematics Stack Exchange that I tried was

A = sprandn(n, n, p)
A = sparse(Symmetric(A))
A = A + n * I(n)

which checks many of the boxes (including the approximate density). However, here I don’t know how to reliably control the condition number.

2 Likes