integration problem

I need to integrate f(x)*cos(x)dx for x from 0 to 2*pi.
For f(x), I have a list of 33 y-values with corresponding x=[0:2*pi/32:2*pi].
How do I integrate this in MATLAB?

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 5 月 17 日

0 投票

trapz(x,y .* cos(x))
mohan krishna
mohan krishna 2023 年 2 月 15 日

0 投票

integral phi/2 0 cosxdx

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

2012 年 5 月 17 日

回答済み:

2023 年 2 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by