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
2021-4-2
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!