How to use trapz for area under curve

2 次查看(过去 30 天)
How do I calcuate the area under orange curve from 0-20.
The orange curve is generated by reva2.

采纳的回答

Sulaymon Eshkabilov
The answer to your exercise is realtively simple:
IND = find(Ua2<=20);
AREA = trapz(Ua2(IND), reva2(IND));
fprintf('The area under the curve within [0, 20] m/s is: %f \n', AREA)
Good luck

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by