The design and performance of a self-adaptive feedforward rf control system are reported. The system was built for the linac of the Accelerator Test Facility (ATF) at Brookhaven National Laboratory. Variables of time along the linac macropulse, such as field or phase are discretized and represented as vectors. Upon turn-on or after a large change in the operating-point, the control system acquires the response of the system to test signal vectors and generates a linearized system response matrix. During operation an error vector is generated by comparing the linac variable vectors and a target vector. The error vector is multiplied by the inverse of the system's matrix to generate a correction vector is added to an operating point vector. This control system can be used to control a klystron to produce flat rf amplitude and phase pulses, to control a rf cavity to reduce the rf field fluctuation, and to compensate the energy spread among bunches in a rf linac. Beam loading effects can be corrected and a programmed ramp can be produced. The performance of the control system has been evaluated on the control of a klystron's output as well as an rf cavity. Both amplitude and phase have been regulated simultaneously. In initial tests, the rf output from a klystron has been regulated to an amplitude fluctuation of less than ±0.3% and phase variation of less than ±0.6°. The rf field of the ATF's photo-cathode microwave gun cavity has been regulated to ±0.5% in amplitude and simultaneously to ±1° in phase. Regulating just the rf field amplitude in the rf gun cavity, we have achieved amplitude fluctuation of less than ±0.2%.