MATLAB解積分方程組
原程序:
r_lower=0.99;
r_point=1;
alpha=0.05;
myfun=@(a,b,r) 1/beta(a,b)*r^(a-1)*(1-r)^(b-1);
myfun1=@(a,b,r) myfun(a,b,r)*r;
myfun2=@(a,b) integral(@(r)myfun(a,b,r),r_lower,1)-alpha;
myfun3=@(a,b) integral(@(r)myfun1(a,b,r),0,1)-r_point;
myfun4=@(r)[myfun2(a,b);myfun3(a,b)];
options=optimset('TolFun',1e-10,'TolX',1e-10);
[x,fval]=fsolve(myfun4,[200;200],options);
程序報(bào)錯(cuò),始終找不到原因,求大神指教

圖1.jpg

圖2.jpg
返回小木蟲查看更多
今日熱帖
京公網(wǎng)安備 11010802022153號(hào)
在這里用句柄函數(shù)來自定義積分方程是不合適的,應(yīng)創(chuàng)建以函數(shù)體的結(jié)構(gòu)形式來自定義積分函數(shù)。

x0=[200;200];
options=optimset('TolFun',1e-10,'TolX',1e-10);
[x,fval]=fsolve(@fun,x0,options);
a = x(1)
b = x(2)
function y=fun(x)
a=x(1);b=x(2);
。。。。。。
end
123a.jpg
,
能不能附上整個(gè)程序過程呢,謝謝
求解方法已上傳,希望題主想一想,動(dòng)動(dòng)手,不要什么都想要。想要的話,可以商榷。
牛