How do I calculate this definite integral in matlab

70 ビュー (過去 30 日間)
Behzad Rahmani
Behzad Rahmani 2021 年 2 月 28 日
コメント済み: amrita jha 2022 年 3 月 29 日
hello. I want to calculate this integral. But it does not answer.
please check it. thanks
clc
clear
syms x
f = (124-x)^3/((12.152-2*x)^2*(1.24-x));
F = int(f, x, 0, 4.23)
  1 件のコメント
amrita jha
amrita jha 2022 年 3 月 29 日
Use "integral" in MATLAB to compute (help integral in MATLAB)
100
-100
f(r)dr

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

回答 (2 件)

darova
darova 2021 年 2 月 28 日
Try trapz
  2 件のコメント
Behzad Rahmani
Behzad Rahmani 2021 年 2 月 28 日
I wrote this code but it did not answer.
clc
clear
n=100
a=0
b=4.23
x=linspace(0,4.23,n)
f =@(x)(124-x).^3/((12.152-2*x).^2*(1.24-x));
trapz(x,f(x));
darova
darova 2021 年 3 月 1 日
You forgot about the dot

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


Steven Lord
Steven Lord 2021 年 2 月 28 日
When I encounter a problem integrating, one of my first thoughts is to look at the function I'm trying to integrate over the interval of integration.
syms x
f = (124-x)^3/((12.152-2*x)^2*(1.24-x));
fplot(f, [0, 4.23])
That section around x = 1.24 could prove problematic.
  2 件のコメント
Behzad Rahmani
Behzad Rahmani 2021 年 3 月 1 日
I calculated this integral with a site and it gave me the number -72828.4694525021.
Now I want to calculate with MATLAB and compare the answers.
amrita jha
amrita jha 2022 年 3 月 29 日
Anyone of you please answer this question..Use "integral" in MATLAB to compute (help integral in MATLAB)
100
-100
f(r)dr

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

カテゴリ

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