- 4 Write A Function With Header M1 M2 Mysplit Matrix M Where M Is A Matrix M1 Is The Left Half Of M And M2 Is T 1 (51.03 KiB) Viewed 41 times
4. Write a function with header [M1, M2] = MySplit Matrix(M), where M is a matrix, M1 is the left half of M, and M2 is t
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. Write a function with header [M1, M2] = MySplit Matrix(M), where M is a matrix, M1 is the left half of M, and M2 is t
4. Write a function with header [M1, M2] = MySplit Matrix(M), where M is a matrix, M1 is the left half of M, and M2 is the right half of M. In the case where there is an odd number of columns, the middle column should go to M1. Hint: The size function will be useful for this. Assume that M has at least two columns. Test Cases: >> M [1 2 3; 4 5 6; 7 8 9] M- 3 7 >> [M1, M2] mySplitMatrix (M) M1 = 1 4 >>mones (5,5); >> [m1, m2]- mySplitMatrix (m) 1 1 1 1 1 1 1 1 1 1 1 147 M2- 7 369 m2 - 1 1 1 258 258 AddH 1 1 1 1 HARIN 1 1 1 1 369