I have the following code:
x = 0:0.001:2.5;
gamma_l = @(x) 2*x;
And I want to integrate the following:
integral( log(gamma_l), 0 , 0.6 )
But it gives me the error:
Undefined function 'log' for input arguments of type 'function_handle'.
I know that I could just define:
gamma_l_l = @(x) log(2*x);
integral( gamma_l_l, 0 , 0.6 )
Because it works in this way. However, I would like to know why the first case does not work. And if there is a way to integrate the function without defining a new function.