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: CO_FirstCrossing.m
    path of file: ./repos/hctsa/Operations
    
    the code of the file until where you have to start completion: function out = CO_FirstCrossing(y,corrFun,threshold,whatOut)
% CO_FirstCrossing  The first crossing of a given autocorrelation across a given threshold
%
%---INPUTS:
%
% y, the input time series
% corrFun, the self-correlation function to measure:
%         (i) 'a
    
function as an inline function
% Eventually could add additional self-correlation functions
switch corrFun
case 'ac'
    % Autocorrelation at all time lags
    % (a little inefficient to not do it incrementally, but maybe Fourier method)
    % (does it anyway...)
    corrs = CO_AutoCorr(y,[],'Fourier');
otherwise
    error('Unknown correlation function ''%s''',corrFun);
end