MATLAB: How to plug in x value after I calculate an indefinite integral

integralMATLAB

For example, I want to get the integral for 1/x, so I wrote
a = int(1/x,x)
a =
log(x)
And then I want to use this function(log(x)). How can I use it?
I have try
f = @x a
f(1)
But it doesn't work.

Best Answer

Hi Jiahui, try
syms x
a = int(1/x,x);
double(subs(a,5))
ans = 1.6094
Related Question