Data-driven deadbeat control with application to output regulation