function [value,isterminal,direction] = exam4e(x,y,Z) % Compute the maxima by finding where the first derivatives vanish. % Note that with three solution components, there are three event % functions. The derivative is evaluated using the DDE. value = exam4f(x,y,Z); % None of the events is terminal. isterminal = zeros(3,1); % Maxima occur where the derivative is going from a positive to a % negative value. direction = -ones(3,1);