From: Steven Lord on 27 Jun 2010 22:39 "Angie" <angie11tr(a)yahoo.com> wrote in message news:i03aa5$t52$1(a)fred.mathworks.com... > Hi, > > Is there a way to solve the following definite integral? My integrand is > symbolic: > > myintegrand = @(x) x*normcdf(x,1,0); > int(myintegrand,x,0,1) > > Matlab says: > Warning: Explicit integral could not be found. ans = > int(x*normcdf(x, 1, 0), x = 0..1) > > Basically, it does not give me an answer. I also tried "erfc" with no > luck. NORMCDF is a function from Statistics Toolbox that's defined for _numeric_ inputs, not symbolic. Using the expression from the documentation for NORMCDF, you can find the value of your integral: syms x t integralBody = exp(-t^2/2); symbolicNormcdf = (1/sqrt(2*sym(pi)))*int(integralBody, -Inf, x); myintegrand = int(x*symbolicNormcdf, 0, 1) VPA this expression to obtain a numeric representation of the result. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
First
|
Prev
|
Pages: 1 2 Prev: Variable names to struct fields and back without file I/O? Next: uigetdir default position |