MATLAB: I need to convert trapz into integral to get a smoother results knowing that A is the x-axis, B is the y-axis

integration

for k = 1 : 3
x = find(A >= 0 & A < k); % Taking the limits of integration
C(1,k) = trapz(A(x),B(x)); % Calculating the integral
end

Best Answer

Try cumtrapz()
Related Question