How to write integral equation ?
조회 수: 4 (최근 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));
댓글 수: 8
추가 답변 (3개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!