一个不难但还是用了4h才做完的实验作业,记录一下~
老师出题也不容易,本文没有源码~
本文仅提供思路及测试数据~
1. 题目:
2. 题目分析
3. 测试数据
A为第一个张量、B为第二个张量、C为张量的积(通过matlap得到的)
3.1方便复制粘贴到代码里的版本
A
0.9597 0.2238
0.3404 0.7513
0.5853 0.2551
0.5060 0.9593
0.6991 0.5472
0.8909 0.1386
0.1493 0.2543
0.2575 0.8143
0.8407 0.2435
0.9293 0.2511
0.3500 0.6160
0.1966 0.4733
B
0.3517 0.5853 0.9172 0.7572
0.8308 0.5497 0.2858 0.7537
0.3804 0.0759 0.5308 0.9340
0.5678 0.0540 0.7792 0.1299
0.5688 0.0119 0.1622 0.3112
0.4694 0.3371 0.7943 0.5285
0.1656 0.2630 0.6892 0.4505
0.6020 0.6541 0.7482 0.0838
3.2规范化格式的数据
A
(:,:,1) =
0.9597 0.2238
0.3404 0.7513
0.5853 0.2551
(:,:,2) =
0.5060 0.9593
0.6991 0.5472
0.8909 0.1386
(:,:,3) =
0.1493 0.2543
0.2575 0.8143
0.8407 0.2435
(:,:,4) =
0.9293 0.2511
0.3500 0.6160
0.1966 0.4733
B
(:,:,1) =
0.3517 0.5853 0.9172 0.7572
0.8308 0.5497 0.2858 0.7537
(:,:,2) =
0.3804 0.0759 0.5308 0.9340
0.5678 0.0540 0.7792 0.1299
(:,:,3) =
0.5688 0.0119 0.1622 0.3112
0.4694 0.3371 0.7943 0.5285
(:,:,4) =
0.1656 0.2630 0.6892 0.4505
0.6020 0.6541 0.7482 0.0838
C
(:,:,1) =
1.8851 1.6168 2.9257 2.2852
2.2007 1.4913 2.7725 2.1023
1.5848 0.9403 2.1304 1.6839
(:,:,2) =
2.2914 1.2096 2.0654 2.5421
2.2776 1.5885 2.8964 1.9761
1.4158 1.1980 2.5356 2.0694
(:,:,3) =
1.9570 0.8128 2.3874 1.7586
2.3188 1.4332 2.6204 2.2451
1.6858 1.1552 2.2087 2.1155
(:,:,4) =
1.7684 1.4351 2.8744 2.1810
2.3584 1.3807 2.6129 1.7987
1.7428 0.8302 1.8004 1.9581