How do you integrate a constant?

11 ビュー (過去 30 日間)
Manil Athapattu
Manil Athapattu 2017 年 6 月 29 日
編集済み: Torsten 2022 年 11 月 21 日
theta and miu are constants
theta = 0.01305
miu = 0.0546
const = @(x) tan(theta + miu)
r = integral(constant,0,1)
  1 件のコメント
Jan
Jan 2017 年 6 月 29 日
The integral of a constant function is the size of the rectangle between the curve and the X axis: const * (1 - 0).

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

採用された回答

Joshua
Joshua 2017 年 6 月 29 日
編集済み: Torsten 2022 年 11 月 21 日
theta = 0.01305
theta = 0.0131
miu = 0.0546
miu = 0.0546
const = @(x) tan(theta + miu)+0*x
const = function_handle with value:
@(x)tan(theta+miu)+0*x
r = integral(const,0,1)
r = 0.0678
  2 件のコメント
Yianni Koumarnetos
Yianni Koumarnetos 2022 年 11 月 21 日
I am doing this and it is telling me that the integral is an error.
Torsten
Torsten 2022 年 11 月 21 日
編集済み: Torsten 2022 年 11 月 21 日
Don't forget the +0*x when integrating your constant function.
Or use
theta = 0.01305
theta = 0.0131
miu = 0.0546
miu = 0.0546
const = @(x) tan(theta + miu)
const = function_handle with value:
@(x)tan(theta+miu)
r = integral(const,0,1,'ArrayValued',true)
r = 0.0678

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by