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: spm_ADEM_set.m
    path of file: ./repos/bspm/thirdparty/spm8
    
    the code of the file until where you have to start completion: function [DEM] = spm_ADEM_set(DEM)
% Performs checks on DEM structures for active inversion
% FORMAT [DEM] = spm_ADEM_set(DEM)
%
% DEM.G  - generative model
% DEM.M  - recognition model
% DEM.C  - exogenous causes
% DEM.U  - prior expectation of causes
%__________________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
 

    
function [DEM] = spm_ADEM_set(DEM)
% Performs checks on DEM structures for active inversion
% FORMAT [DEM] = spm_ADEM_set(DEM)
%
% DEM.G  - generative model
% DEM.M  - recognition model
% DEM.C  - exogenous causes
% DEM.U  - prior expectation of causes
%__________________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
 
% Karl Friston
% $Id: spm_ADEM_set.m 3893 2010-05-17 18:28:52Z karl $
 
% check recognition model
% -------------------------------------------------------------------------
try
    DEM.M = spm_DEM_M_set(DEM.M);
catch
    errordlg('please check your inversion model')
end