0
votes

I'm having some trouble trying to solve and plot an integral in matlab. In fact, I know that if a solve one, I'll solve all the integrals that I need now.

I have plot in x axis a value of a variable "d" and in y axis the value of a integral of a normalized gaussian function from -inf to ((40*log10(d)-112)/36) and I'm not finding out a way to do it correctly. D is between 0 and 1600

Can anybody here please help me?

1
Perhaps showing your tentative code would be helpful. Also, the integral of a Gaussian is a complementary error function. - Vitality
the problem about using (1/2) error function is that somewhere in this function it'll cross the middle of the gaussian (but you helped me to think it better, now a have a new ideia, thanks a lot!) - PauloI
for now, my tentative code to calculate it is: for d = 10:10:1590; b = (1/((2*pi)^(1/2))).*int((exp(-((x).^2)/2)),-inf,((40*log10(d)-112)/36)); %(23) end and then even if it's right (it might be), I'm not achieving to plot it in the way I want. - PauloI

1 Answers

1
votes

In Matlab you can use the integral-function to evaluate integrals:

q = integral(fun,xmin,xmax)

fun needs to be a function handle, also called function functions, like these two examples:

square = @(x) x.^2;
plusone = @(x) x+1;