In Matlab, I need to create a symmetric matrix with a given sparsity pattern and whose condition number is low ($\leq 10$). The matrix is sparse (more than half of its entries are zero).
From what I already know, generally if diagonal entries are larger and if the value of the entries are taken from a function, the condition number will be low.
Update
As an example of structure, we can consider Jacobian matrices or matrices whose graph is a star.
Is there a reason you are not using
sprandsym(n,density,rc)withdensity$\geq 0.5$ andrc$\in (0.1,\infty)$ (documentation)?