I understand that you are trying to rotate the radiation pattern of an antenna defined in the Antenna Toolbox. You probably tried to achieve this by using the “rotpat” function. However, this required you to create a custom antenna element to which the rotated radiation pattern can be assigned. If you do not want to create a custom antenna but rather want to use an antenna defined in the toolbox, you can consider tilting the antenna in a direction of your choice.
An example for tilting an antenna from the toolbox is shown below:
ant = hornConical; % conical horn antenna from library
figure;pattern(ant,8e9); % maximum along -y direction
ant.TiltAxis = 'Z'; % tilt the antenna along z-axis
ant.Tilt = 90; % tilt it for an angle of 90 degrees
figure;pattern(ant,8e9); % resulting maximum along +x direction