<正>SFC RF cavity is a resonant cavity 1/4 wavelength(showed in Fig.1), there is a strict relation between resonant frequency F and length L. When accelerator system changes the sort of beam current, radio frequency must be changed too. But the mechanical structure of short-plate position system of RF cavity is very complex, when changing frequency every time, we need do adjustment again and again. It very wastes time and energy. In order to realize exact presetting of frequency, we base on a great deal of discrete data and make use of curve fitting algorithm which is least-squares and polynomial of Matlab as well as visual programming method, and program the computing and curve fitting program. We preset frequency according to the result of the computing program, the result is fitted very well. It improves our work efficiently.