How to write integral equation ?
10 次查看(过去 30 天)
显示 更早的评论
I like to check if my code represent the equation. Please help
10 个评论
采纳的回答
David Hill
2020-9-5
Not sure if your Ca is sorted. Yes, you have a stream of data that is being integrated. The proper function is trapz(). Providing your full code helped significantly. I assume you want your data sorted before integrating.
[Ca,idx]=sort(dataB(:,1));
Da=dataB(:,2);
Da=Da(idx);%aligns Da to sorted Ca
DaveA=trapz(Ca,Da)/(Ca(end)-Ca(1));
更多回答(3 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!