function example_2D()
    % Load example data
    %**********************************************************************
    % Data structure
    %**********************************************************************
    % - scans{i}.position: Position of the robot when taking the i'th scan
    %   - position(1): X coordinate of the robot
    %   - position(2): Y coordinate of the robot
    %   - position(3): Orientation of the robot
    % 
    % - scans{i}.scan: coordinates of the i'th scan taken by the robot
    %   - scan(1,:): X coordinates of the i'th scan
    %   - scan(2,:): Y coordinates of the i'th scan
    load 'scans_2D' scans;
    
    % Get number of scans.
    numScans = length(scans);
    
    % Initialize M and colors
    S = [];

    % Initialize graphic objects
    figure
    mainAx = axes;
    mapObj = plot(mainAx, nan,nan,'b.');
    axis(mainAx,'equal');
        
    % Iterate over each image taken with the RGB-D camera
    for scanID = 1:numScans
        % Load Template PC.
        T = scans{scanID}.scan;
        robotPos = scans{scanID}.position;
        
        % Calculate new cam position and update M
        S = PCMerge(S, T, robotPos); 

        % Display progress
        disp(['Scan ',num2str(scanID),' out of ', num2str(numScans)]);
        mapObj.XData = S(1,:);
        mapObj.YData = S(2,:);
        
        % Refresh interface
        refresh;
        drawnow;
    end
end