how do I do Integration
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
when f(x)=2,x1=0.1 and x2=0.5. How do i do integration of f(x) from x1 to x2
0 comentarios
Respuesta aceptada
DGM
el 5 de Oct. de 2021
Editada: DGM
el 5 de Oct. de 2021
For a constant function like that, you could just do it geometrically:
f = 2;
xrange = [0.1 0.5];
s = f*abs(diff(xrange))
For a general symbolic approach, start with something like this instead
syms x
f = 2 + 0*x; % this just forces f to be a symbolic expression
s = int(f,[0.1 0.5])
s = double(s) % maybe you want a numeric representation instead
Try another
f = 2*sin(x) + 5*x + 3*x^2; % a bit more complicated
s = int(f,[0.1 0.5])
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Number Theory en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!