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: nex_wf.m
    path of file: ./repos/EEGapp/EEGapp/custom_stuff/Chronux/chronux_2_12/dataio/HowToReadNexFilesInMatlab
    
    the code of the file until where you have to start completion: function [adfreq, n, ts, nf, w] = nex_wf(filename, varname)
% nex_wf(filename, varname): Read waveform variable from a .nex file
%
% [adfreq, n, ts, nf, w] = nex_wf(filename, varname)
%
% INPUT:
%   filename - if empty string, will use File Open dialog
%   varname - variable name
%
%           
% OUTPUT:
%   n - number of waveforms
%   ts - array of waveform timestamps (in seconds)
%   nf - number of data points in each waveform
%   w - matrix of waveform a/d values [n nf] (in millivolts)

n = 0;
adfreq = 0;
ts = 0;
nf = 0;

    
function [adfreq, n, ts, nf, w] = nex_wf(filename, varname)
% nex_wf(filename, varname): Read waveform variable from a .nex file
%
% [adfreq, n, ts, nf, w] = nex_wf(filename, varname)
%
% INPUT:
%   filename - if empty string, will use File Open dialog
%   varname - variable name
%
%           
% OUTPUT:
%   n - number of waveforms
%   ts - array of waveform timestamps (in seconds)
%   nf - number of data points in each waveform
%   w - matrix of waveform a/d values [n nf] (in millivolts)

n = 0;
adfreq = 0;
ts = 0;
nf = 0;
w = 0;

if(nargin ~= 2)
   disp('2 input arguments are required')
   return
end