Two problems:I have a function
B(m,n) = Integration of this between 1 and 0 (x.^m-1).*((1-x).^n-1)
For my m file i have
function Beta = B(m,n)
x=quad('@B',0,1);
Beta=(x.^m-1).*((1-x).^n-1);
however when i run my m-file it doesnt work. Can anybody help me please
function integral=quadEvaluator(m,n)
% Evaluates the integral of (x.^m-1).*((1-x).^n-1)
% over the interval 0<x<1 and with given input values of m and n
functionString = ['(x.^', num2str(m), '-1).*((1-x).^', num2str(n), '-1)'];
% Creates the equation substituting in values of m and n
% Using the square braces concatenates everything together
fprintf('Evaluating the integral of ')
fprintf(functionString)
fprintf(' over the interval 0<x<1)
% Nice printout to verify the proper function is being evaluated
integral = quad(functionString, 0, 1);