# Numerical integration in Matlab

8 views (last 30 days)
Raj Patel on 19 Sep 2020
Answered: Vasishta Bhargava on 19 Sep 2020
Evaluate the integral as a function of x and t. I want to perform numerical integration over x. The integral is: Can someone help me solve it using MATLAB?
Raj.

Walter Roberson on 19 Sep 2020
There is only a single integration symbol. You can only integrate over one variable. We cannot tell which variable as the d* was left out. It would make the most sense if it were x, which would also be consistent with your statement that you want to numerically integrate over x.
Because you are integrating over a single variable, you need a specific numeric t if you want to do numeric integration. If you want the result with t as a variable then you would have to use symbolic integration.
Raj Patel on 19 Sep 2020
Ok. I'll try using symbolic integration.
Walter Roberson on 19 Sep 2020
Note that the integration is discontinuous as t crosses 0

Vasishta Bhargava on 19 Sep 2020
% if true
% code
% end
t = 2;
fun = @(x,t) (1./exp(0.014342./(x*t))).*(1./x.^4)
A = integral(@(x) fun(x,t),0,2)