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: time_to_transfer_window.m
    path of file: ./repos/Orbital_Mechanics
    
    the code of the file until where you have to start completion: function time_to_transfer_window(phi, n1, n2, t12)
    %% Calculate the time to transfer window
    %
    % Jeremy Penn
    % 06/11/2017
    %
    % Revision: 06/11/2017
    %
    % function time_to_transfer_window(phi, n1, n2, t12)
    %
    % Purpose: This function calculates the time to an open planetary
    %          transfer window
    %

    
function time_to_transfer_window(phi, n1, n2, t12)
    %% Calculate the time to transfer window
    %
    % Jeremy Penn
    % 06/11/2017
    %
    % Revision: 06/11/2017
    %
    % function time_to_transfer_window(phi, n1, n2, t12)
    %
    % Purpose: This function calculates the time to an open planetary
    %          transfer window
    %
    % Input:  o phi   - The phase angle between n1 and n2 and t = 0 [deg]
    %         o n1    - The mean motion of the departing planet [rad/day]
    %         o n2    - The mean motion of the target planet [rad/day]
    %         o t12   - The transfer time of the Hohmann transfer to n1 to
    %                   n2 [day]
    %
    clc;
    
    %% select the two planets
    dep_planet = input('Input the depature planet:\n','s');
    arr_planet = input('Input the arrival planet:\n','s');
    
    dep_planet_data = planet_select(dep_planet);
    arr_planet_data = planet_select(arr_planet);
    
    if nargin == 0
        phi = input('Input the current phase angle between the departure and arrival planets (deg):\n');
        n1  = (2*pi)/dep_planet_data(8);
        n2  = (2*pi)/arr_planet_data(8);
        t12 = time_of_transfer(dep_planet_data(5), arr_planet_data(5));
        t12 = t12 / 86400; % convert to days
    end