File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,39 @@ It's also possible to run a map over the matrix:
7878 return $element * $element
7979 });
8080
81+ If you need to combine together matrices, you can do so by calling the concatenation methods:
82+
83+ $m1 = new Matrix([
84+ [1,2,3],
85+ [4,5,6],
86+ ]);
87+
88+ $m2 = new Matrix([
89+ [7],
90+ [8],
91+ ]);
92+
93+ $m3 = new Matrix([[3,2,1]]);
94+
95+ $m4 = $m1->concatenateRight($m2);
96+ // [
97+ // [1,2,3,7],
98+ // [4,5,6,8],
99+ // ]
100+
101+ $m5 = $m1->concatenateBottom($m3);
102+ // [
103+ // [1,2,3],
104+ // [4,5,6],
105+ // [3,2,1],
106+ // ]
107+
81108## Change-log
82109
110+ - 1.2.0
111+ - Added ` concatenateBottom($other) `
112+ - Added ` concatencateRight($other) `
113+
83114- 1.1.0
84115 - Added ` diagonal() ` .
85116
You can’t perform that action at this time.
0 commit comments