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_softmax.m
    path of file: ./repos/bspm/thirdparty/spm8
    
    the code of the file until where you have to start completion: function [y] = spm_softmax(x,k)
% softmax (neural transfer)  function
% FORMAT [y] = spm_softmax(x,k)

    
function [y] = spm_softmax(x,k)
% softmax (neural transfer)  function
% FORMAT [y] = spm_softmax(x,k)
%
% x - vector of activity
% k - temperature or inverse sensitivity parameter (default k = 1)
%
% y   = exp(k*x)/sum(exp(k*x))
 
%___________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston
% $Id: spm_softmax.m 4187 2011-02-01 20:13:57Z karl $
 
% apply
%--------------------------------------------------------------------------
if nargin == 1
    k = 1; 
end