function [MatchingCastIndices, mintime] = matchingCastIndices(BOG_DATE_TIME, RSKprofiledatetime)
    % Calculate the time difference between BOG and RSK datetime arrays
    TimeDifference = abs(BOG_DATE_TIME - RSKprofiledatetime);
    
    % Find the minimum time difference
    mintime = min(TimeDifference);
    
    % Define the maximum allowed time difference (10 minutes in this case)
    MinTimeDifference = duration(0,10,0);
    
    % Check if the minimum time difference exceeds the allowed difference
    if mintime > MinTimeDifference
        % If no matching cast is found, return an array of NaNs and mintime
        MatchingCastIndices = false(size(TimeDifference));
    else
        % If a matching cast is found, return logical indices of all matches
        MatchingCastIndices = TimeDifference == mintime;
    end
end
