MATLAB: Inner matrix error for parameterized function in integral script.

inner matrixintegral

Hello!
I've got a little issue here. The general idea behind the function is that I am looking to define the parameters (a,b,x_min,x_max), then have an integral be calculated of a sin times sin function. It seems I am doing something wrong that upsets Matlab. I've added my script below, and added it in a file.
function [q] = integral_sina_sinb(a,b,x_min,x_max)
fun = @(x,a,b) sin(a.*x.*pi)*sin(b.*x.*pi);
q = integral(@(x)fun(x,a,b),x_min,x_max);
end
Now in the command window I type integral_sina_sinb(1,2,0.3,0.6).
After which it returns a series of errors, Which I doubt I need to post. I assume the error has something to do with my period placement or the variables inside the @(..).
Thank you for reading my query.

Best Answer

fun = @(x,a,b) sin(a.*x.*pi) .* sin(b.*x.*pi);