Hi Ollie,
to get the area under the curve, just add another integration variable that integrates over the curve, y(2), I called it f(4). To locate the peak of the curve use an events function as shown below. ve contains the time stamp of the peak.
y0 = [S0 I0 R0 0];
%using the ode45 function to perform intergration
options = odeset('Events',@events);
[t,y,ve,~,~] = ode45(@sir_rhs, tspan, y0, options, pars);
figure()
plot(t,y(:,2),t,y(:,4));
xlim(tspan);
ylabel('Population (n)');
xlabel('Time (days)');
legend('Infected','Location','SouthEast');
function f = sir_rhs(~,y,pars)
f = zeros(4,1);
f(1) = -pars(1)*y(1)*y(2);
f(2) = pars(1)*y(1)*y(2) - pars(2)*y(2);
f(3) = pars(2) * y(2);
f(4) = y(2);
end
function [value,isterminal,direction] = events(~,y,pars)
value = pars(1)*y(1)*y(2) - pars(2)*y(2);
isterminal = 0; % Do not stop the integration when zero is detected
direction = 0; % Detect all zeros
end