各位大大,我想求一個累加函式取最小值時,x(1),x(2)的值,但現在報錯
我想了很久沒弄明白左右側什么意思,求各位大大指教,以下為代碼
A=[9.08304E-06
1.0719E-05
1.03485E-05
1.39805E-05
1.41988E-05
1.43738E-05
3.02467E-05
3.05519E-05
2.88175E-05
2.98161E-05
2.99163E-05
2.51716E-05
2.99348E-05
3.73563E-05
3.85825E-05
3.46999E-05
0.00006
5.92859E-05
6.05514E-05
4.95082E-05
6.09037E-05
4.5849E-05
6.59665E-05
7.26735E-05
8.69993E-05
5.38942E-05
9.0079E-05
8.74036E-05
0.000112302
0.000112992
8.60866E-05
8.87324E-05
7.73286E-05
9.83428E-05
0.00010038
0.000101869
0.000169451
0.000105115
9.32897E-05
0.000132309
0.000155726
0.000144192
0.000123105
0.000164526
0.000215021
0.000199756
0.000261111
0.000215768
0.000314948
0.000237097
0.000297101
0.000414809
0.001221953
0.002325];
B=[8.249468485
8.325307542
8.408937475
8.507923906
8.647148397
8.93276606
9.209197186
9.321029632
9.416447351
9.511909383
9.619282632
9.771298055
9.934195708
10.09636551
10.26280312
10.4241184
10.73393091
11.0883769
11.35197973
11.60349377
11.8658347
12.12935643
12.33020313
12.60764381
12.92511056
13.20195167
13.53837375
13.91332397
14.22753147
14.50524533
14.77203804
14.98931262
15.23308958
15.59154932
15.94142354
16.31399327
16.67099259
16.98450143
17.32953195
17.72889531
18.18565563
18.63759354
19.09069163
19.51201864
20.09281098
20.76053008
21.48746073
22.23980519
23.05727916
23.90178641
24.76397558
26.00285947
29.24242776
38.68443594];
f=@(x)sum(abs(1.4379*10.^(-2)*((B-x(1))/(1-B/(0.9*x(2))).^0.5).^3.13330-A*10.^(6)));
x0 = [1,500];
options = optimset('MaxFunEvals',10000,'MaxIter',2e3);
fminsearch(f,x0,options);
復制代碼
報錯:無法執行賦值,因為左側的大小為 1-by-1,右側的大小為 1-by-54。
出錯 fminsearch (line 200)
fv(:,1) = funfcn(x,varargin{:});
出錯 shishi (line 113)
fminsearch(f,x0,options)
求各位大大指教
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/194517.html
標籤:其他
