error when trying to integrate this function in a plot

1 view (last 30 days)
so im trying to integrate this, but i mostly get errors when trying a few things:
a = logspace(-3,0,200)
fun = @(x)((exp(-H1(1)*abs(a)-H2*sqrt(a.^2+m0^2)))./(abs(a)+sqrt(a.^2+m0^2)).*(exp(j*a.*(X1(1)-Xg(1)))))
Zint = fun(x)
Zint_real = real(Zint);
Zint_imag = imag(Zint);
semilogx(a,Zint_real)
hold on
semilogx(a,Zint_imag)
hold off
integrate(fun(x))
also get this error message: Undefined function 'integrate' for input arguments of type 'double'.
what am i doing wrong?
  5 Comments
Danny
Danny on 25 Mar 2019
it does depend on a, so i should atleast change x to a right?

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!