作者reddragon00 (00)
看板MATLAB
標題[問題]有關積分問題想請教大家一下
時間Tue Feb 26 09:58:13 2013
請教一下各位大大
剛接觸matlab不久,忽然要寫出這樣的function對我而言有些吃力
對一個連乘的標準常態(theta*x)*Gammapdf做0.001到T的積分
我寫的 function 如下,但是一直跑不出結果,請各位大大能為我指點一下
萬分感謝
function [Pd Ps]=defaul_survival_prob(T,nu,sigma,theta,)
N=length(theta);
for j=1:N
if j==1
phi(j)=@(x)normcdf((theta(j).*x)./(sigma(j).*sqrt(x)));
else j>1;
phi(j)=@(x)normcdf((theta(j).*x)./(sigma(j).*sqrt(x)))...
*normcdf((Li(j-1)-m(j-1)*T-VG_theta(j-1).*x)./(sigma(j-1).*sqrt(x)));
end
end
Fzd=@(phi)phi(N).*gampdf(T/nu,1/nu);
Pd=quad(Fzd,0.001,T);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.65.140
1F:推 sunev:Nonscalar arrays of function handles are not allowed; 02/26 10:18
2F:→ sunev: use cell arrays instead. 02/26 10:19
3F:→ reddragon00:可以請教一下如何改善這個問題嗎? 02/26 10:38