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: sumn.m
    path of file: ./repos/spinw/external
    
    the code of the file until where you have to start completion: function A = sumn(A,dim, varargin)
% sum of array elements along multiple dimensions
%
% S = SUMN(A,dim,...)
%
% Works the same way as the Matlab built-in sum() function, but it can do
% summation along multiple dimensions with a single call.

    
function A = sumn(A,dim, varargin)
% sum of array elements along multiple dimensions
%
% S = SUMN(A,dim,...)
%
% Works the same way as the Matlab built-in sum() function, but it can do
% summation along multiple dimensions with a single call.
%
% See also SUM.
%

if nargin == 0
    help sumn
    return
end