Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: trapz, numerical integration
Date: Sun, 7 Jun 2009 19:03:01 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 23
Message-ID: <h0h2t5$juo$1@fred.mathworks.com>
References: <h048vl$2v$1@fred.mathworks.com> <h04bpo$2vo$1@fred.mathworks.com> <h0fudh$pfo$1@fred.mathworks.com> <h0gade$kfk$1@fred.mathworks.com> <h0gr9d$6db$1@fred.mathworks.com> <h0h0d0$897$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244401381 20440 172.30.248.38 (7 Jun 2009 19:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 7 Jun 2009 19:03:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:545361


Why not use regular old Gauss legendre:

setb0=-4.5313
setb1=2.7481
mhat=2.6470
pc=gaussquad(@(gr) exp(setb0+setb1.*gr)./(1+exp(setb0+setb1.*gr)).*1/mhat.*exp(-gr./mhat),0,200)
pc = 

     0.551709492450232



b0=-5;
b1=3;
m=3
pc= quadgr(@(t) exp(b0+b1.*t)./(1+exp(b0+b1.*t)).*1/m.*exp(-t./m),0,200)

pc =
         0.584733311243339



http://www.mathworks.com/matlabcentral/fileexchange/8679