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: smooth.m
    path of file: ./repos/mtex/EBSDAnalysis/@grain2d
    
    the code of the file until where you have to start completion: function grains = smooth(grains,iter,varargin)
% constraint laplacian smoothing of grain boundaries
%
% Input
%  grains - @grain2d
%  iter   - number of iterations (default: 1)
%
% Output
%  grains - @grain2d
%

    
function grains = smooth(grains,iter,varargin)
% constraint laplacian smoothing of grain boundaries
%
% Input
%  grains - @grain2d
%  iter   - number of iterations (default: 1)
%
% Output
%  grains - @grain2d
%
% Options
%  moveTriplePoints  - do not exclude triple/quadruple points from smoothing
%  moveOuterBoundary - do not exclude outer boundary from smoothing
%  second_order, S2  - second order smoothing
%  rate              - default smoothing kernel  
%  gauss             - Gaussian smoothing kernel  
%  exp               - exponential smoothing kernel  
%  umbrella          - umbrella smoothing kernel   
 
if nargin < 2 || isempty(iter), iter = 1; end