I want to solve an integration with Symbolic math toolbox. However it seems that there is a problem whith double and sym variables. I wrote this code:
function [q] = Eq27(Lg,x,r) q = 0; for k = 0:floor(x) for l = 0:Lg-1 q =((-1^l)/(factorial(l)factorial(k)))nchoosek(Lg+k,k+l+1)((r(k-x))^(k+1))exp(-1r*(k-x)); end end q = ((1-r)^Lg)* q;
and defined Lg, x, and r as symbolic variables. However, whenever I run it this error message appears: ??? Error using ==> sym.double at 25 DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> sym.colon at 20 n = double((b-a)/d);
Error in ==> Eq27 at 3 for k = 0:floor(x)
It seems that there is a prolem with using floor function on 'x'.