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_ssm2s.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function [s,u] = spm_ssm2s(P,M,TOL)
% Converts state-space (M) representation to eigenspectrum
% FORMAT [s,u] = spm_ssm2s(P,M)
%
% P    - model parameters
% M    - model (with flow M.f and expansion point M.x and M.u)

    
function [s,u] = spm_ssm2s(P,M,TOL)
% Converts state-space (M) representation to eigenspectrum
% FORMAT [s,u] = spm_ssm2s(P,M)
%
% P    - model parameters
% M    - model (with flow M.f and expansion point M.x and M.u)
% TOL  - optional upper bound for  principality exponent  (default -4)
%
% S    - (sorted) eigenspectrum or Lyapunov exponents
% V    - associated eigenvectors
%
% csd  - cross spectral density
%__________________________________________________________________________
% Copyright (C) 2012 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston
% $Id: spm_ssm2s.m 6233 2014-10-12 09:43:50Z karl $

% preliminaries
%--------------------------------------------------------------------------
if nargin < 3, TOL = -4; end