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: animate.m
    path of file: ./repos/quad_geometric_control/models/@RigidbodyAttitude
    
    the code of the file until where you have to start completion: function animate(obj,opts_in)
% function to animate the quadrotor

%%
% default options
opts_default.RATE = 25;
opts_default.data.t = [];
opts_default.data.x = [];
opts_default.data.xd = [];
opts_default.data.td = [];

opts_default.vid.MAKE_MOVIE = 0;
opts_default.vid.filename = 'results/vid1';
opts_default.vid.Quality = 100;
opts_default.vid.FrameRate = 24;

opts_default.frame.move = false;
opts_default.frame.view = {40,25};

xd_flag = false;

%% frame
% initialize the animation figure and axes
    figure_x_limits = [-1 1];
    figure_y_limits = [-1 1];
    figure_z_limits = [-1 1] ;
  
    
function drawQuadrotor(parent,x)
    tem = get(parent,'Children');
    delete(tem);
    
    xQ = zeros(3,1) ;
    [R, ~]=obj.unzipState(x);
    s.L = 0.175; %length of quadrotor boom
    s.R = 0.1; %radius of propeller prop

    BRW = R' ;
    point1 = BRW'*[s.L,0,0]';
    point2 = BRW'*[0,s.L,0]';
    point3 = BRW'*[-s.L,0,0]';
    point4 = BRW'*[0,-s.L,0]';

    nprop = 40;
    propangs = linspace(0,2*pi,nprop);
    proppts = s.R*BRW'*[cos(propangs);sin(propangs);zeros(1,nprop)];

    wp = xQ;
    wp1 = wp + point1;
    wp2 = wp + point2;
    wp3 = wp + point3;
    wp4 = wp + point4;
    wp_cable_attach = wp + BRW'*[0;0;0] ; %[0;0;-params.cable_attach_d];

    prop1 = proppts + wp1*ones(1,nprop);
    prop2 = proppts + wp2*ones(1,nprop);
    prop3 = proppts + wp3*ones(1,nprop);
    prop4 = proppts + wp4*ones(1,nprop);

    lwp = 2 ;
    lw1 = 1 ;
    lwc = 2 ;
    lwl = 2 ;

    s.qhandle1 = line([wp1(1),wp3(1)],[wp1(2),wp3(2)],[wp1(3),wp3(3)]); hold on ;
    s.qhandle2 = line([wp2(1),wp4(1)],[wp2(2),wp4(2)],[wp2(3),wp4(3)]);
    set(s.qhandle1,'Color','k', 'LineWidth',lw1);
    set(s.qhandle2,'Color','k', 'LineWidth',lw1);

    s.hprop1 = plot3(prop1(1,:),prop1(2,:),prop1(3,:),'r-', 'LineWidth',lwp);
    s.hprop2 = plot3(prop2(1,:),prop2(2,:),prop2(3,:),'b-', 'LineWidth',lwp);
    s.hprop3 = plot3(prop3(1,:),prop3(2,:),prop3(3,:),'b-', 'LineWidth',lwp);
    s.hprop4 = plot3(prop4(1,:),prop4(2,:),prop4(3,:),'b-', 'LineWidth',lwp);

%     s.hload = plot3(xL(1,1), xL(2,1), xL(3,1), 'k.', 'LineWidth',lwl) ;
%     s.xLcom = plot3(xLcom(1,1,j), xLcom(1,2,j), xLcom(1,3,j), 'ko', 'LineWidth',lwl) ;
%     s.cable = plot3([wp_cable_attach(1) xL(1,:)], [wp_cable_attach(2) xL(2,:)], [wp_cable_attach(3) xL(3,:)], ':m','LineWidth',lwc) ;

    drawFrame(R,xQ,.25);
    grid on

    view(opts.frame.view{:});
    % view([-1,-1,1])
    % view(40,5)
    % view(0,0);
    % view(0,90);

    xlbl = xlabel('$$\textbf{X}$$','Interpreter','Latex'); xlbl.FontSize = 15;
    ylbl = ylabel('$$\textbf{Y}$$','Interpreter','Latex'); ylbl.FontSize = 15;
    zlbl = zlabel('$$\textbf{Z}$$','Interpreter','Latex'); zlbl.FontSize = 15;

end