How to use trap(x,y) integral over a finite distance?

조회 수: 1 (최근 30일)
Ayob
Ayob 2019년 1월 27일
답변: KSSV 2019년 1월 28일
Hi everyone,
I want to integrate over a finite distance for a set of numerical data. For better explanation, I have vectors of X=[] and Y=[], and I want to compute trap(X,Y) over a finit distance of [a,b]. For exmple, int( F(x), a,b)) is a proper function but it doesn't cover numerical data like vectors.
Unfortunatly, it is not possible for use fit any curve or limit X and Y vectors to the finite distance of [a,b] due to the considerable work that I will face.
How can I solve this problem?
  댓글 수: 1
Jim Riggs
Jim Riggs 2019년 1월 28일
Your question is confusing to me. I can't find a Matlab function "trap". Do you mean "trapz"?
Have you looked at help for trapz?

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2019년 1월 28일
As you have (x,y) in hand..you can restrict your coordinates and use trapz. YOu can use inequalitties like < and > to pick yopur required region.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by