function R = meanNND3d(M); % Calculates the mean nnd of a 3d group, using the raw matrix as the input individual = allnn3d(M); findmean = mean(individual); R = findmean;