Random matrix with locally-varying potential