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: drawEllipse3d.m
    path of file: ./repos/matGeom/matGeom/geom3d
    
    the code of the file until where you have to start completion: function varargout = drawEllipse3d(varargin)
%DRAWELLIPSE3D Draw a 3D ellipse.
%
%   Possible calls for the function :
%   drawEllipse3d([XC YC ZC A B THETA PHI])
%   drawEllipse3d([XC YC ZC A B THETA PHI PSI])
%   drawEllipse3d([XC YC ZC A B], [THETA PHI])
%   drawEllipse3d([XC YC ZC A B], [THETA PHI PSI])
%   drawEllipse3d([XC YC ZC A B], THETA, PHI)

    
function varargout = drawEllipse3d(varargin)
%DRAWELLIPSE3D Draw a 3D ellipse.
%
%   Possible calls for the function :
%   drawEllipse3d([XC YC ZC A B THETA PHI])
%   drawEllipse3d([XC YC ZC A B THETA PHI PSI])
%   drawEllipse3d([XC YC ZC A B], [THETA PHI])
%   drawEllipse3d([XC YC ZC A B], [THETA PHI PSI])
%   drawEllipse3d([XC YC ZC A B], THETA, PHI)
%   drawEllipse3d([XC YC ZC], A, B, THETA, PHI)
%   drawEllipse3d([XC YC ZC A B], THETA, PHI, PSI)
%   drawEllipse3d([XC YC ZC], A, B, THETA, PHI, PSI)
%   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI)
%   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI, PSI)
%
%   where XC, YC, ZY are coordinate of ellipse center, A and B are the
%   half-lengths of the major and minor axes of the ellipse,
%   PHI and THETA are 3D angle (in degrees) of the normal to the plane
%   containing the ellipse (PHI between 0 and 360 corresponding to
%   longitude, and THETA from 0 to 180, corresponding to angle with
%   vertical).
%   
%   H = drawEllipse3d(...)
%   return handle on the created LINE object
%   
%   Example
%     figure; axis([-10 10 -10 10 -10 10]); hold on;
%     ellXY = [0 0 0  8 5  0 0 0];
%     drawEllipse3d(ellXY, 'color', [.8 0 0], 'linewidth', 2)
%     ellXZ = [0 0 0  8 2  90 90 90];
%     drawEllipse3d(ellXZ, 'color', [0 .8 0], 'linewidth', 2)
%     ellYZ = [0 0 0  5 2  90 0 90];
%     drawEllipse3d(ellYZ, 'color', [0 0 .8], 'linewidth', 2)
% 

% ------
% Author: David Legland
% E-mail: david.legland@inrae.fr
% Created: 2008-05-07
% Copyright 2008-2023 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas)

%   Possible calls for the function, with number of arguments :
%   drawEllipse3d([XC YC ZC A B THETA PHI])             1
%   drawEllipse3d([XC YC ZC A B THETA PHI PSI])         1
%   drawEllipse3d([XC YC ZC A B], [THETA PHI])          2
%   drawEllipse3d([XC YC ZC A B], [THETA PHI PSI])      2
%   drawEllipse3d([XC YC ZC A B], THETA, PHI)           3
%   drawEllipse3d([XC YC ZC A B], THETA, PHI, PSI)      4
%   drawEllipse3d([XC YC ZC], A, B, THETA, PHI)         5
%   drawEllipse3d([XC YC ZC], A, B, THETA, PHI, PSI)    6
%   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI)         7
%   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI, PSI)    8

% extract handle of axis to draw on
[hAx, varargin] = parseAxisHandle(varargin{:});

% extract drawing options
ind = find(cellfun(@ischar, varargin), 1, 'first');
options = {};
if ~isempty(ind)
    options = varargin(ind:end