function DailyAnomalies = calculateDailyAnomalies(param, time)
    % Convert serial date number to datetime
    time = datetime(time, 'ConvertFrom', 'datenum');
    
    % Convert datetime to datenum and extract the unique days
    uniqueDays = unique(floor(datenum(time)));
    
    % Initialize DailyAnomalies array
    DailyAnomalies = zeros(length(uniqueDays), 1);
    
    % Loop over each unique day
    for i = 1:length(uniqueDays)
        % Get the indices for the current day
        currentDayIndices = floor(datenum(time)) == uniqueDays(i);
        
        % Calculate the mean param for the current day
        meanParam = mean(param(currentDayIndices));
        
        % Calculate the DailyAnomalies for the current day
        DailyAnomalies(i) = param(currentDayIndices) - meanParam;
    end
end
