close all;
clear all;
clc;
A = rand(8,10);
A = A.*10;
A
B = rand(10,8);
B = B.*10;
B
C = rand(8,8);
C = C.*10;
C
if det(2-C) == 0
error('error: singuljarnaja matrica');
end;
x=(C-A*B)*inv(2-C);
x = round(x);
x
' Proverka: '
' pravaja storona: '
f=2*x+A*B
' levaja storona: '
g=x*C+C
------------------------------------------------------------------------------------------------
A =
Columns 1 through 7
9.5013 8.2141 9.3547 1.3889 4.4510 8.3812 3.0462
2.3114 4.4470 9.1690 2.0277 9.3181 0.1964 1.8965
6.0684 6.1543 4.1027 1.9872 4.6599 6.8128 1.9343
4.8598 7.9194 8.9365 6.0379 4.1865 3.7948 6.8222
8.9130 9.2181 0.5789 2.7219 8.4622 8.3180 3.0276
7.6210 7.3821 3.5287 1.9881 5.2515 5.0281 5.4167
4.5647 1.7627 8.1317 0.1527 2.0265 7.0947 1.5087
0.1850 4.0571 0.0986 7.4679 6.7214 4.2889 6.9790
Columns 8 through 10
3.7837 8.1797 8.3850
8.6001 6.6023 5.6807
8.5366 3.4197 3.7041
5.9356 2.8973 7.0274
4.9655 3.4119 5.4657
8.9977 5.3408 4.4488
8.2163 7.2711 6.9457
6.4491 3.0929 6.2131
B =
Columns 1 through 7
7.9482 1.3652 5.8279 2.0907 4.1537 2.1396 6.8333
9.5684 0.1176 4.2350 3.7982 3.0500 6.4349 2.1256
5.2259 8.9390 5.1551 7.8333 8.7437 3.2004 8.3924
8.8014 1.9914 3.3395 6.8085 0.1501 9.6010 6.2878
1.7296 2.9872 4.3291 4.6110 7.6795 7.2663 1.3377
9.7975 6.6144 2.2595 5.6783 9.7084 4.1195 2.0713
2.7145 2.8441 5.7981 7.9421 9.9008 7.4457 6.0720
2.5233 4.6922 7.6037 0.5918 7.8886 2.6795 6.2989
8.7574 0.6478 5.2982 6.0287 4.3866 4.3992 3.7048
7.3731 9.8833 6.4053 0.5027 4.9831 9.3338 5.7515
Column 8
4.5142
0.4390
0.2719
3.1269
0.1286
3.8397
6.8312
0.9284
0.3534
6.1240
C =
Columns 1 through 7
6.0854 7.1763 6.9921 2.7310 0.4975 4.3979 4.5860
0.1576 6.9267 7.2751 2.5477 0.7838 3.4005 8.6987
0.1635 0.8408 4.7838 8.6560 6.4082 3.1422 9.3424
1.9007 4.5436 5.5484 2.3235 1.9089 3.6508 2.6445
5.8692 4.4183 1.2105 8.0487 8.4387 3.9324 1.6030
0.5758 3.5325 4.5075 9.0840 1.7390 5.9153 8.7286
3.6757 1.5361 7.1588 2.3189 1.7079 1.1975 2.3788
6.3145 6.7564 8.9284 2.3931 9.9430 0.3813 6.4583
Column 8
9.6689
6.6493
8.7038
0.0993
1.3701
8.1876
4.3017
8.9032
x =
Columns 1 through 6
-2131 -2176 -3707 82 -1590 5119
-1367 -1421 -2374 95 -1035 3298
-1439 -1485 -2503 73 -1085 3464
-1816 -1883 -3164 98 -1375 4388
-1675 -1769 -2930 103 -1287 4070
-1661 -1731 -2890 95 -1263 4011
-1409 -1430 -2447 60 -1046 3377
-1188 -1301 -2090 116 -940 2930
Columns 7 through 8
-227 2821
-167 1824
-164 1915
-214 2420
-205 2249
-194 2218
-156 1868
-176 1622
ans =
Proverka:
ans =
pravaja storona:
f =
1.0e+004 *
Columns 1 through 7
-0.3806 -0.4068 -0.7089 0.0446 -0.2780 1.0568 -0.0140
-0.2463 -0.2617 -0.4473 0.0404 -0.1749 0.6866 -0.0083
-0.2573 -0.2777 -0.4763 0.0331 -0.1868 0.7162 -0.0107
-0.3263 -0.3510 -0.6028 0.0467 -0.2396 0.9115 -0.0122
-0.2977 -0.3346 -0.5593 0.0419 -0.2246 0.8444 -0.0185
-0.2980 -0.3261 -0.5489 0.0411 -0.2181 0.8305 -0.0126
-0.2508 -0.2611 -0.4638 0.0315 -0.1766 0.6977 -0.0063
-0.2108 -0.2424 -0.3952 0.0436 -0.1607 0.6166 -0.0146
Column 8
0.5807
0.3729
0.3939
0.4998
0.4644
0.4575
0.3851
0.3380
ans =
levaja storona:
g =
1.0e+003 *
Columns 1 through 7
-3.1608 -3.3333 -3.2911 -3.3302 -3.2181 -3.2842 -3.3002
-2.0220 -2.0659 -2.0157 -2.0734 -1.9729 -2.0194 -2.0383
-2.1454 -2.2554 -2.2047 -2.2645 -2.1452 -2.2159 -2.2243
-2.7261 -2.8383 -2.7940 -2.8259 -2.7419 -2.7546 -2.7884
-2.5117 -2.6935 -2.6252 -2.6763 -2.5621 -2.5824 -2.6694
-2.4829 -2.6283 -2.5355 -2.6040 -2.4805 -2.5464 -2.5655
-2.0547 -2.1107 -2.1040 -2.1646 -2.0337 -2.1400 -2.1079
-1.7842 -1.8749 -1.8261 -1.8544 -1.7827 -1.7491 -1.8529
Column 8
-3.4473
-2.2072
-2.3381
-2.9400
-2.7470
-2.6837
-2.2435
-1.9223