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: sw_uniquetol.m
    path of file: ./repos/spinw/swfiles
    
    the code of the file until where you have to start completion: function [unique, firstIdx] = sw_uniquetol(M,tol)
% returns the unique column vectors within tolerance
% 
% ### Syntax
% 
% `[Mu, firstIdx] = sw_uniquetol(M,tol)`
% 
% ### Description
% 
% `[Mu, firstIdx] = sw_uniquetol(m,tol)` returns unique column vectors
% within the given `tol` tolerance. Two column vectors are considered
% unequal, if the distance between them is larger than the tolerance
% ($\delta$):

    
function [unique, firstIdx] = sw_uniquetol(M,tol)
% returns the unique column vectors within tolerance
% 
% ### Syntax
% 
% `[Mu, firstIdx] = sw_uniquetol(M,tol)`
% 
% ### Description
% 
% `[Mu, firstIdx] = sw_uniquetol(m,tol)` returns unique column vectors
% within the given `tol` tolerance. Two column vectors are considered
% unequal, if the distance between them is larger than the tolerance
% ($\delta$):
%
% $\sqrt{\sum_i (V_i-U_i)^2} < \delta$
% 
% ### Input Arguments
% 
% `M`
% : Matrix that contains column vectors.
% 
% `tol`
% : Distance tolerance, default value is $10^{-5}$.
% 
% ### Output Arguments
% 
% `Mu`
% : Matrix that contains the unique column vectors.
%
% `firstIdx`
% : Indices pointing to the first occurence of the unique element.
%
% This function is similar to the Matlab built-in
% `unique(M,'rows','first')`, but with controllable tolerance.
%
% ### See Also
%
% [unique](https://ch.mathworks.com/help/matlab/ref/unique.html)
%

if nargin == 0
    swhelp sw_uniquetol
    return
end