We inverted seismic field data for a continuous, laterally invariant P-wave velocity profile. Instead of the usual approach that involves horizontal layers with piecewise constant densities and velocities, we consider models of one or two layers with a constant gradient of the squared slowness above a homogeneous halfspace. With a single layer above a halfspace, there are three parameters. With two layers, there are five. We solve the inverse problem by a direct grid search over a wide range of parameters. The results were compared to that of a piecewise-constant multi-layer inversion result. In the single-layer case, either the shallow or the deeper part of the model would match the multi-layer case, depending on which modes of the surface waves were selected. With two layers, a considerably better agreement is obtained over a larger depth range. Our method is limited to cases with a small Vs/Vp-ratio but has only 5 parameters. It could be a useful alternative to piecewise-constant multi-layer inversion, in particular if continuous P-velocity profiles are sought. These are sometimes better suited as a starting model for full waveform inversion than models with many discontinuities.