Question: Row sort Write a function called CustomSort that takes an n x m 2D array in Mat with random integers between-100 and 100 (inclusive), and


Row sort Write a function called CustomSort that takes an n x m 2D array in Mat with random integers between-100 and 100 (inclusive), and produces an n x m array called outMat, which consists of sorted values in inMat such that the lowest value in inMat is the (1.1) position in outMat. CustomSort orders the remaining elements from left to right on the first row until the last column, progressing with each row. Hint: The internal functions sort and reshape should be used. Restrictions: Loops should not be used Ex: inMat - 8 19 8 11 17 6 12 16 12 16 2 19 11 16 2 3); [outMat) - CustomSort( inmat) produces 6 outMat - 2 8 12 16 3 11 2 8 12 17 16 19 16 19 Restbecaused Dizzy Shift Write a function called Shifter that takes a 2D array inArray and i) creates an array circleft that contains the circular left shift by one position of all the columns of inArray in a 2D array, ii) creates an array called circUp that contains the circular up shift by one position of all the rows of inArray, and it) creates an array called circ2x that first circularly shifts the columns of inArray by one position, and with the resulting array, shifts all the rows up by one position. The function must operate on a 2D array of any size. Hint: Array indexing, single colon and end should be used. Restrictions: For loops, while loops, circshift, and any other internal functions should not be used Ex: inArray = [6,7,43 10,1,5; 2,9,5); circleft, circup, circ2x ] = Shifter( inArray) produces circleft - 7 1 10 5 circup - 1 5 2 10 9 5 circup 10 1 5 N 9 5 6 7 4 circ2x = 1 1 5 10 9 5 ON 7 4 Function 1 function [ circLeft, circup, circ2x ] = Shifter( inArray) 2 % Your code goes here % 3 4 5 end 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
