I have an equation in Matlab according to X parameter . I want to find the amount of X for the random amounts of F(x) . and I tried the code below . but It gives me two different results while my equation should have just one result .
even I tried the roots(f)
instead of solve(f)
but it gave me an error :
??? Undefined function or method 'isfinite' for input arguments of type 'sym'.
anybody can help me in this ? what should I do ? even if I have a wrong idea about solving this problem please tell me . Thank you
function betaDistribution_2(a,b)
syms x ; y=inline((x^(a-1))*((1-x)^(b-1))); beta=quad(y,0,1); g=(1/beta)*(x^(a-1))*((1-x)^(b-1)); % I have this equation and I want to find the amount of x for the random %amounts of p p=int(g,x,0,x); for i=0:50 fxi=rand(1); f=p-fxi; xi=solve(f); result=eval(xi); disp(result) end end