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: simulate.m
    path of file: ./repos/hongbomiao.com/aerospace/quadcopter-pd-controller
    
    the code of the file until where you have to start completion: function [t_out, s_out] = simulate(generateTrajectoryHandle, getControllerHandle)
    %% QUADCOPTER SIMULATION
    addpath('utils');

    % real-time

    
function [t_out, s_out] = simulate(generateTrajectoryHandle, getControllerHandle)
    %% QUADCOPTER SIMULATION
    addpath('utils');

    % real-time
    real_time = true;

    % max time
    max_time = 20;

    % parameters for simulation
    params = getSysParams;

    %% FIGURES
    disp('Initializing figures...');
    h_fig = figure;
    h_3d = gca;
    axis equal;
    grid on;
    view(3);
    xlabel('x [m]');
    ylabel('y [m]');
    zlabel('z [m]');
    quadcolors = lines(1);

    set(gcf, 'Rend