In linear particle accelerators used for free-electron lasers, it is often required that the electron bunches experience the same electric field as they pass through the accelerating structures. For radio frequency (RF) pulsed mode machines, like the SwissFEL, this means that the amplitude and phase of the RF pulses feeding the structures through the waveguides should be kept constant over the pulselength. This raises an interesting problem that can be addressed by an iterative learning control (ILC) technique. This method manipulates the input waveforms iteratively, in order to generate flat amplitude and phase pulses at the output of the system. In this paper, we introduce two ILC algorithms, one with a model and one without, which have been tested on three different high-power RF subsystems, namely, the klystron, pulse compressor, and RF Gun.