load('hokuyo_and_phidget_measurement_data.mat', 'scanner_data');

result = cell(20,3);

for i = 1:20
    
    x_G = zeros(1,682);
    y_G = zeros(1,682);
    z_G = zeros(1,682);

    for j = 1:682
        
        x_G(j) = scanner_data{i, 1}(j);
        y_G(j) = scanner_data{i, 2}(j) * cosd(scanner_data{i, 3});
        z_G(j) = scanner_data{i, 2}(j) * sind(scanner_data{i, 3});
    end
   
    result{i, 1} = x_G;
    result{i, 2} = y_G;
    result{i, 3} = z_G;
       
end

figure;
hold on;

for k = 1:20
    for m = 1:682
        if abs(result{k, 1}(m))<700 && abs(result{k, 2}(m))<700 
            plot3(result{k, 1}, result{k, 2}, result{k, 3}, 'b.');
        end
    end
end

xlim([-700,700]);
ylim([-700,700]);

