MATLAB: Request of calculating mixed integral – from -Inf to k

integration

Hello,
I have a simple question, but i cannot solve it. I would like to evaluate the integral of the function:
f=exp(-x) between -Inf and k.
I tried to use quad and int, but I haven't succedded both because of the -Inf and the k.
Please, let me know how to tackle such a problem, knowing that k is a symbol.
Kind regards, Antonio

Best Answer

If k is a symbol, you will have to use the symbolic toolbox.
syms x k
int(exp(-x), x, -inf, k)
Hint: the answer is infinity unless k is -infinity