In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. Example 1: Input: nums = [[1,2], [3,4]] r = 1, c = 4 Output: [[1,2,3,4]] Explanation: The row-trave…