Integration within particular range

Dear All,
I want to integrate the x, y. I use trapz(x,y). It gives me 1000. X-range id 0 to 4.45. But how to integrate with upper limit and lower limit i.e. 2 to 3. How to do it ? x is the first column and y is the 2nd column of the attached excel sheet.

2 件のコメント

Torsten
Torsten 2019 年 3 月 12 日
x ranges from 0.3 to 4.4. How do you want to integrate from 100 to 500 ? Or do you mean the row number ?
Manish Kumar
Manish Kumar 2019 年 3 月 12 日
i have edited the question.

サインインしてコメントする。

 採用された回答

Torsten
Torsten 2019 年 3 月 12 日

0 投票

idx = x>=2 && x<=3;
xp = x(idx);
yp = y(idx);
value = trapz(xp,yp)

3 件のコメント

Manish Kumar
Manish Kumar 2019 年 3 月 12 日
Error is coming. I am attching the scrrenshot
Torsten
Torsten 2019 年 3 月 12 日
idx = (x>=2 & x<=3);
Manish Kumar
Manish Kumar 2019 年 3 月 12 日
Thank you sir

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2019 年 3 月 12 日

コメント済み:

2019 年 3 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by