function labels = checkCoords(lats, lons)
    % Load coastlines data
    load coastlines

    lats_clean = cellfun(@(x) x(~isnan(cell2mat(x))), lats, 'UniformOutput', false);
    lons_clean = cellfun(@(x) x(~isnan(cell2mat(x))), lons, 'UniformOutput', false);
    
    % Create a world map
    figure;
    worldmap([min(cellfun(@min, lats_clean))-1 max(cellfun(@max, lats_clean))+1], ...
             [min(cellfun(@min, lons_clean))-1 max(cellfun(@max, lons_clean))+1]);

    % Plot coastlines
    plotm(coastlat, coastlon, 'k');

    % Initialize cell array to store labels
    labels = cell(size(lats));

    for i = 1:numel(lats)
        % Check if point is over land or water
        isOverLand = inpolygon(lons{i}, lats{i}, coastlon, coastlat);
        
        % Assign labels (0 for over land, 1 for over water)
        labels{i} = double(~isOverLand);
    end

    % Close the figure
    close(gcf);
end


