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: dss_check_adaptivity.m
    path of file: ./repos/fieldtrip/external/dss
    
    the code of the file until where you have to start completion: function state = dss_check_adaptivity(state)
% Check adaptivity of alpha, beta & gamma


    
function state = dss_check_adaptivity(state)
% Check adaptivity of alpha, beta & gamma

% Copyright (C) 2004, 2005 DSS MATLAB package team (dss@cis.hut.fi).
% Distributed by Laboratory of Computer and Information Science,
% Helsinki University of Technology. http://www.cis.hut.fi/projects/dss/.
% $Id$

state.adapt_alpha=0;
if isfield(state, 'alphaf')
    p = feval(state.alphaf.h);
    if p.adaptive==1
        state.adapt_alpha=1;
        dss_message(state, 1, 'Adaptive alpha\n');
    else
        [state.alphaf.params, state.alpha] = feval(state.alphaf.h, state.alphaf.params, state);
        dss_message(state, 1, sprintf('Constant alpha: %d\n', state.alpha));
    end