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_ness_Sp2N.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function [m,C] = spm_ness_Sp2N(Sp,n,K)
% Convert polynomial potential parameters into a Gaussian density
% FORMAT [m,C] = spm_ness_Sp2N(Sp,[n,K])
%--------------------------------------------------------------------------
% Sp - Polynomial coefficients or parameters of log density
% n  - Dimensionality of state space
% K  - Order of polynomial expansion (K = 3 corresponds to quadratic)
%
% m  - (Gaussian) mean
% C  - (Gaussian) covariance
%__________________________________________________________________________

% Karl Friston

    
function [m,C] = spm_ness_Sp2N(Sp,n,K)
% Convert polynomial potential parameters into a Gaussian density
% FORMAT [m,C] = spm_ness_Sp2N(Sp,[n,K])
%--------------------------------------------------------------------------
% Sp - Polynomial coefficients or parameters of log density
% n  - Dimensionality of state space
% K  - Order of polynomial expansion (K = 3 corresponds to quadratic)
%
% m  - (Gaussian) mean
% C  - (Gaussian) covariance
%__________________________________________________________________________

% Karl Friston
% Copyright (C) 2008-2022 Wellcome Centre for Human Neuroimaging


% defaults
%--------------------------------------------------------------------------
if nargin < 3, K = 3; end