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: gen.m
    path of file: ./repos/hctsa/Toolboxes/OpenTSTOOL/tstoolbox/utils
    
    the code of the file until where you have to start completion: function s = gen(mode, len, frequency, samplerate, amplitude, startphase, yunit)

% signal/gen
%
% generate various kind of signals with time axis
%
% si = gen(mode, len, frequency, samplerate, amplitude, startphase, yunit)
%
% len is measured in seconds
% frequency, samplerate in Hertz
% amplitude is measured in the current yunit (default is dimensionless)
% startphase in radians

    
function s = gen(mode, len, frequency, samplerate, amplitude, startphase, yunit)

% signal/gen
%
% generate various kind of signals with time axis
%
% si = gen(mode, len, frequency, samplerate, amplitude, startphase, yunit)
%
% len is measured in seconds
% frequency, samplerate in Hertz
% amplitude is measured in the current yunit (default is dimensionless)
% startphase in radians
% yunit is an optional argument
%
% mode may be one of the following :
% sine              - sinusodial signal between [-amplitude +amplitude]
% unoise            - uniform distrubuted random numbers in interval [-amplitude +amplitude]
% gnoise            - gaussian random numbers with zero mean
% fnoise            - spectral flat noise with zero mean (DC value = 0)
% rect				- rectangular signal with values discret values 0 and amplitude
% symmrect          - rectangular signal with values discret values -amplitude and amplitude
% comb              - train of (one sample wide) spikes of height amplitude, otherwise signal is zero
% 
%
% cmerk Feb. 1998

if nargin < 1
	mode = 'sine';		% sine, uniform noise, gaussian noise, rect, puls ...
end