Can't read integral method

1.3k Views Asked by At

I type this :

fun = @(x) exp(-x.^2).*log(x).^2; 
q = integral(fun,2,4); 
q;

when I run the above code, I get an error message

Undefined function or method 'integral' for input arguments of type 'function_handle'.

Can you help me to solve this problem?

My Matlab is R2010 MATLAB

2

There are 2 best solutions below

2
On BEST ANSWER
>> fun = @(x) exp(-x.^2).*log(x).^2; 
>> q = integral(fun,2,4); 
>> q

q =

    0.0026

it works,what is problem?

maybe in 2010 there is function int, http://www.mathworks.com/help/symbolic/int.html

please check it

0
On

This is not a math question, but a programming question.

Replace integral with rbdthbtbtn or something and you will get the analogous error message, which means there is no function integral, which in turn probably means that you do not have the toolbox you expected to have.