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_mci_diag.m
    path of file: ./repos/spm12/toolbox/mci/inference
    
    the code of the file until where you have to start completion: function [mess] = spm_mci_diag (post,diag)
% Monte Carlo Diagnostics
% FORMAT [mess] = spm_mci_diag (post,diag)
%
% post      posterior distribution
% diag      diagnostic info
%           .ind            indices of samples to look at
%           .traceplot      (1/0) for trace plots
%           .autoplot       (1/0) for autocorrelations
%           .essplot        (1/0) for effective sample sizes
%           .eplot          (1/0) for energy (neg log joint) traj

    
function [mess] = spm_mci_diag (post,diag)
% Monte Carlo Diagnostics
% FORMAT [mess] = spm_mci_diag (post,diag)
%
% post      posterior distribution
% diag      diagnostic info
%           .ind            indices of samples to look at
%           .traceplot      (1/0) for trace plots
%           .autoplot       (1/0) for autocorrelations
%           .essplot        (1/0) for effective sample sizes
%           .eplot          (1/0) for energy (neg log joint) traj
%           .bplot          (1/0) for Bayes factor of f/b transitions
%
% ess      effective sample size (for each parameter)
%__________________________________________________________________________
% Copyright (C) 2015 Wellcome Trust Centre for Neuroimaging

% Will Penny
% $Id: spm_mci_diag.m 6697 2016-01-27 14:57:28Z spm $

Ns=size(post.P,2);
try, traceplot=diag.traceplot; catch, traceplot=1; end