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: ep2ap.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/tides/tidal_ellipse
    
    the code of the file until where you have to start completion: function [Au, PHIu, Av, PHIv, w]=ep2ap(SEMA, ECC, INC, PHA, plot_demo)
% Convert tidal ellipse parameters into amplitude and phase lag parameters.
% Its inverse is app2ep.m. Please refer to app2ep for the meaning of the 
% inputs and outputs.

    
function [Au, PHIu, Av, PHIv, w]=ep2ap(SEMA, ECC, INC, PHA, plot_demo)
% Convert tidal ellipse parameters into amplitude and phase lag parameters.
% Its inverse is app2ep.m. Please refer to app2ep for the meaning of the 
% inputs and outputs.
%
% Zhigang Xu
% Oct. 20, 2000
%
% Document:  tidal_ellipse.ps
% 
if nargin < 5
     plot_demo=0;  % by default, no plot for the ellipse
end