Integration of a function

1 次查看(过去 30 天)
Owen McKim
Owen McKim 2021-12-4
回答: VBBV 2021-12-4
Using the MATLAB intergral function you can integrate a function between a min and max value. integral(fun,min,max)
But I was wondering how you can show the intergated equation in MATLAB?
For example, If i intergrate I would get . How can a display that in MATLAB.
Thanks

回答(4 个)

KSSV
KSSV 2021-12-4
syms x
f = 3*x-x^2 ;
iwant = int(f,x)
iwant = 

Chunru
Chunru 2021-12-4

John D'Errico
John D'Errico 2021-12-4
Integral is a NUMERICAL tool for integration, uing adaptive numerical methods. It will return a NUMERICAL result, and only applies to definite integrals. Nothing more.
You need to use symbolic tools to perform an integration. That means you need to use syms.
syms x % creates x as a symbolic variable
int(x^2 + 2) % use int, NOT integral
ans = 

VBBV
VBBV 2021-12-4
syms x
f = 3*x-x^2 ;
F = int(f,x);
expand(F)
ans = 

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by