For medical irradiation, beams with a uniform distribution have been requir
ed. We have proposed a method to control the beam profile using an octupole
magnet. We have installed an octupole magnet and confirmed its effectivene
ss at the Heavy Ion Medical Accelerator in Chiba (HIMAC) beam-transport lin
e. A beam efficiency of 91% can be realized with a flatness of +/-4% over t
he range of +/-15 mm, The beam offset at the position of the octupole magne
t is required to be within +/-0.2 mm to realize this condition. This method
is expected to have a beam efficiency higher than that of the ordinary met
hod using wobbler magnets and a scatterer system.