搜索内容 搜索用户

# 10 麦片

050

1主题 0最佳答案

 本帖最后由 溜溜梅 于 2019-8-12 17:53 编辑 求高手帮我看看这个程序怎么计算出表达式的积分，可能是因为结果太小而只显示0，想用符号变量来做，但是integral2函数又会提示错误，错误是说调用某个函数的时候要求的是数值，但是我用的符号。求大神指教，万分感谢f.m中的代码 function z = f(a,x ) n=80;    p=8; K=50; T=2309; beta=711; theta=3.6288e+06; w=[126;126;96;96;63;63;30;30]; TIJ=[686,810,1658,1790,2185,0,0     801,2202,2212,2217,0,0,0     351,1026,1840,2150,0,0,0     1097,1584,1755,2032,0,0,0     233,359,701,1867,2110,0,0     1842,0,0,0,0,0,0     0,0,0,0,0,0,0     310,530,918,1096,1582,0,0     106,118,1713,2056,0,0,0     102,525,952,1209,1267,1716,2125     1962,2053,2119,2174,0,0,0     819,1479,0,0,0,0,0     1029,1074,1112,1147,1865,1954,0     0,0,0,0,0,0,0     1795,1862,1963,0,0,0,0     1158,1744,0,0,0,0,0     1665,0,0,0,0,0,0     1465,0,0,0,0,0,0     1269,0,0,0,0,0,0     59,1164,1500,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     177,334,592,639,820,1792,0     1461,0,0,0,0,0,0     914,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     1026,0,0,0,0,0,0     0,0,0,0,0,0,0     1170,0,0,0,0,0,0     0,0,0,0,0,0,0     779,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     0,0,0,0,0,0,0     458,0,0,0,0,0,0     0,0,0,0,0,0,0     569,992,0,0,0,0,0     540,0,0,0,0,0,0     0,0,0,0,0,0,0     936,0,0,0,0,0,0     532,0,0,0,0,0,0     0,0,0,0,0,0,0     484,0,0,0,0,0,0     0,0,0,0,0,0,0]; TIE=[2309;2309;2279;2279;2246;2246;2213;2213;2096;2182;2174;2183;2131;1452;2174;2086 2138;1938;2058;2138;1543;1248;1603;1804;1523;2175;1573;1196;1445;1145;1235;1270;1266 1369;788;983;1262;1019;1178;728;1121;966;1130;1029;1180;944;1051;672;781;28]; w=round(w.*9.45); TIJ=round(TIJ.*9.45); TIE=round(TIE.*9.45); T=round(T*9.45); S1=0; for i=1:1:p     S1=w(i).^x+S1; end S2=0; for i=1:1:K     S2=TIE(i).^x+S2; end non0=(TIJ~=0); ni=sum(non0,2); %计算ni的值 S4=1; for i=1:1:K     for j=1:1:ni(i)         if ni(i)==0             break;         end         S4=((TIJ(i,j)).^(x-1)).*S4;     end end A = S2-S1+theta; B = S4; % z = a.^(n+beta).*x.^n.*exp(-(A).*a).*B;        %%最终表达式 end 复制代码main.m中的代码 x1=0.9; x2=1.1; fa=@(a,x)f(a,x); integral2(fa,0,inf,x1,x2)复制代码

# 513 麦片

5001500

5主题 112最佳答案
• 关注者： 24

 过去太久，不知道你是不是已经解决了

# 10 麦片

050

1主题 0最佳答案
楼主| 发表于 2019-9-18 20:16:30 | 显示全部楼层
 jiangxuzhen 发表于 2019-9-18 20:12 过去太久，不知道你是不是已经解决了 还没有啊，还望指教啊大神:'(:'(

 您需要登录后才可以回帖 登录 | 注册 本版积分规则 回帖后跳转到最后一页