MATLAB: Maximizing value for an array with integral function.

arrayarray integrationfor loopintegralintegrationmaximizingupper and lower limits

I have 'time(t)' and 'acceleration(A)' values. t1 and t2 are the lower and upper limits, where (t2-t1 = 10).
f = max{((integration(A,t,t1,t2))^2.5) * (t2-t1)}
Please help me to put this function in my matlab code.
for t1=1:length(t)
for t2=t1:t1+10
f = (((int(A,t,t1,t2)))^2.5)*(t2-t1);
end
end
I am using this for loop, but getting error for integration.

Best Answer

fmax = -Inf;
for t1=1:numel(t)-10
fmax = max((trapz(t(t1:t1+10),A(t1:t1+10)))^2.5*(t(t1+10)-t(t1)),fmax);
end
fmax
Best wishes
Torsten.