Sample-and-hold solution of a consensus problem with nonlinear dynamics and input/output disturbances