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: plotWD.m
    path of file: ./repos/MSS/HYDRO
    
    the code of the file until where you have to start completion: function plotWD(vessel,x_axis,velno)
% plotWD plots the wave drift amplitudes 
%
%    plotWD(vessel,x_axis,velno)      
%
%    plotWD(vessel,'s',1)      - period in seconds

    
function plotWD(vessel,x_axis,velno)
% plotWD plots the wave drift amplitudes 
%
%    plotWD(vessel,x_axis,velno)      
%
%    plotWD(vessel,'s',1)      - period in seconds
%    plotWD(vessel,'hz',1)     - 1/s
%   plotWD(vessel,'rads',1)    - rad/s
%
% Inputs: 
%    vessel: MSS vessel structure
%    x_axis {'rads','s','hz'}
%    velno  (optionally):  speed number
%
% Author:    Thor I. Fossen
% Date:      2007-06-27
% Revisions: 

velocities = vessel.velocities;

nvel  = length(velocities);

if nargin == 2
    velno = 1;
elseif nargin > 3
    disp('Error: wrong number of input arguments')
    return
end