We present a new nonlinear optimization procedure for the computation of generalized Gaussian quadratures for a broad class of square integrable functions on intervals. While some of the components of this algorithm have been previously published, we present a simple and robust scheme for the determination of a sparse solution to an underdetermined nonlinear optimization problem which replaces the continuation scheme of the previously published works. The new algorithm successfully computes generalized Gaussian quadratures in a number of instances in which the previous algorithms fail. Four applications of our scheme to computational physics are presented: the construction of discrete plane wave expansions for the Helmholtz Green’s function, the design of linear array antennae, the computation of a quadrature for the discretization of Laplace boundary integral equations on certain domains with corners, and the construction of quadratures for the discretization of Laplace and Helmholt...