Question: Row sort Write a function called CustomSort that takes an n m 2 D array inMat with random integers between - 1 0 0 and

Row sort
Write a function called CustomSort that takes an nm2D array inMat with random integers between -100 and 100(inclusive), and
produces an mn 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:
Function 0
1 function [outMat]= CustomSort ( inMat )
% Takes a 2D array inMat with random integers between (inclusively)-100 and 100,
% and produces an m by n array outMat that consists of sorts values
% in in at such that the lowest value in inMat is the (1,1) position
% the first, and order the remaining elements left to right on
7 the first row till last column, starting with the next row and so on.
 Row sort Write a function called CustomSort that takes an nm2D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!