You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rotate.m
    path of file: ./repos/mtex/SO3Fun/@SO3FunRBF
    
    the code of the file until where you have to start completion: function SO3F = rotate(SO3F,rot,varargin)
% rotate function on SO(3) by a rotation
%
% Syntax
%   SO3F = rotate(SO3F,rot)
%   SO3F = rotate(SO3F,rot,'right')
%
% Input
%  SO3F - @SO3FunRBF
%  rot  - @rotation
%
% Output
%  SO3F - @SO3FunRBF
%
% See also
% SO3FunHandle/rotate_outer
    
if check_option(varargin,'right')

    
function SO3F = rotate(SO3F,rot,varargin)
% rotate function on SO(3) by a rotation
%
% Syntax
%   SO3F = rotate(SO3F,rot)
%   SO3F = rotate(SO3F,rot,'right')
%
% Input
%  SO3F - @SO3FunRBF
%  rot  - @rotation
%
% Output
%  SO3F - @SO3FunRBF
%
% See also
% SO3FunHandle/rotate_outer
    
if check_option(varargin,'right')
  cs = SO3F.CS.rot;
  if length(cs)>2 && ~any(rot == cs(:))
    warning('Rotating an ODF with crystal symmetry will remove the crystal symmetry')
    SO3F.CS = crystalSymmetry;
  end