function m = scriptcommand( m, commandname, varargin )
%m = scriptcommand( m, commandname, varargin )
%   Execute the command with the given name.  The arguments are varargin.

    replaceM = isempty(m);
    m = feval( [ 'leaf_' commandname ], m, varargin{:} );
    if ~isempty(m)
        m = recordcommand( m, replaceM, commandname, varargin{:} );
    end
end

