Undefined variable error while performing numerical integration in MATLAB -
for matlab question, need integrate fun2 = @(x) 1/(sigma2*(2*pi)^(.5))*exp(-.5*((x-xbar2)/sigma2)^2)
, sigma2=50
, xbar2=1500
.
the area under curve should 0.05, set solve(integrate(fun2,-inf,u)==.05,u)
error "undefined function or variable 'u'."
what can make work?
so here go:
syms x u fun = int(1./(50.*(2.*pi).^(.5)).*exp(-.5.*((x-1500)./50).^2),-inf,u) - .05; double(solve(fun,u))
Comments
Post a Comment