comparison +blockmatrix/multiplyTest.m @ 425:e56dbd9e4196 feature/grids

Merge feature/beams
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 07 Feb 2017 16:09:02 +0100
parents 288138d9586d
children
comparison
equal deleted inserted replaced
423:a2cb0d4f4a02 425:e56dbd9e4196
1 function tests = multiplyTest()
2 tests = functiontests(localfunctions);
3 end
4
5
6 function testMultiply(testCase)
7 a11 = [
8 0.8147 0.1270;
9 0.9058 0.9134;
10 ];
11 a12 = [
12 0.6324 0.2785 0.9575;
13 0.0975 0.5469 0.9649;
14 ];
15 a21 = [
16 0.1576 0.9706;
17 ];
18 a22 = [
19 0.9572 0.4854 0.8003;
20 ];
21 A = {
22 a11 a12;
23 a21 a22;
24 };
25
26 b11 = [
27 0.1419 0.9157 0.9595;
28 0.4218 0.7922 0.6557;
29 ];
30 b12 = [
31 0.0357 0.9340;
32 0.8491 0.6787;
33 ];
34 b21 = [
35 0.7577 0.6555 0.0318;
36 0.7431 0.1712 0.2769;
37 0.3922 0.7060 0.0462;
38 ];
39 b22 = [
40 0.0971 0.3171;
41 0.8235 0.9502;
42 0.6948 0.0344;
43 ];
44
45 B = {
46 b11 b12;
47 b21 b22;
48 };
49
50
51 C = {
52 a11*b11 + a12*b21, a11*b12 + a12*b22;
53 a21*b11 + a22*b21, a21*b12 + a22*b22;
54 };
55
56 testCase.verifyEqual(blockmatrix.multiply(A,B), C);
57 end