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: ftestmtm.m
    path of file: ./repos/acycle/code/seriesanalysis
    
    the code of the file until where you have to start completion: 

function [freq,ftest,fsig,Amp,Faz,Sig,Noi] = ftestmtm(t,y,NW,dof,npad)
%   Adaptive-weighted harmonic F-test, Thomson multitaper method.
%
%   INPUTS:
%	t (column vector) = timescale of y; **must be uniformly sampled. 
%	y (column vector) = real-valued time series to be tested. 
%	NW = time-bandwidth product
%   dof (column vector) = adaptive-weighted dofs (from mtmdofs.m)
%   >> NOTE: if dof is missing, high-resolution option is used.
%   npad = zero pad to npad * length of y 
%
%   CALLS TO:
%   dpss.m (discrete prolate spheroidal sequences, MATLAB Signal Toolbox
    
function [freq,ftest,fsig,Amp,Faz,Sig,Noi] = ftestmtm(t,y,NW,dof,npad)
%   Adaptive-weighted harmonic F-test, Thomson multitaper method.
%
%   INPUTS:
%	t (column vector) = timescale of y; **must be uniformly sampled. 
%	y (column vector) = real-valued time series to be tested. 
%	NW = time-bandwidth product
%   dof (column vector) = adaptive-weighted dofs (from mtmdofs.m)
%   >> NOTE: if dof is missing, high-resolution option is used.
%   npad = zero pad to npad * length of y 
%
%   CALLS TO:
%   dpss.m (discrete prolate spheroidal sequences, MATLAB Signal Toolbox)
%   fcdf.m (Fisher cumulative distribution function, MATLAB Statistics Toolbox)
%
%  The F-ratio statistic ("F-test") is distributed as an F pdf
%  with 2 and kdof (high-resolution) or dof(f)-2 (adaptive-weighted) DOFs
%
%   OUTPUTS:
%	Freq = vector of frequencies
%	ftest = vector with F-ratios
%	fsig = vector of 1-alpha probability for the F-ratios
%   Amp = vector of harmonic amplitude 
%   Faz = vector of harmonic phase (in degrees)
%   Sig = vector of signal (F-ratio nominator)
%   Noi = vector of noise (F-ratio denominator)
%  
%   REFERENCE:
%   Thomson, D.J., 1982. Spectrum estimation and harmonic analysis. 
%      Proceedings of the IEEE, 70, 1055-1096.
% 
% Linda Hinnov (George Mason University)

Amp=[ ];Noi=[ ];Sig=[ ];ftest=[ ];fsig=[ ];freq=[ ];Faz=[ ];
N = length(y);
if nargin<4, disp('NOTE: using high-resolution option'); end