Integration of a function

5 visualizaciones (últimos 30 días)
Owen McKim
Owen McKim el 4 de Dic. de 2021
Respondida: VBBV el 4 de Dic. de 2021
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

Respuestas (4)

KSSV
KSSV el 4 de Dic. de 2021
syms x
f = 3*x-x^2 ;
iwant = int(f,x)
iwant = 

Chunru
Chunru el 4 de Dic. de 2021

John D'Errico
John D'Errico el 4 de Dic. de 2021
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 el 4 de Dic. de 2021
syms x
f = 3*x-x^2 ;
F = int(f,x);
expand(F)
ans = 

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by