Answered step by step
Verified Expert Solution
Question
1 Approved Answer
No find() ifs elses fors or any interation/Conditionals MATLAB No find() ifs elses fors or any interation/Conditionals MATLAB Input: 1. (MxN double or char) Array
No find() ifs elses fors or any interation/Conditionals MATLAB
No find() ifs elses fors or any interation/Conditionals MATLAB
Input: 1. (MxN double or char) Array 2. (1x2 char) Array containing the sort instructions Output: 1. (MxN double orchar) Sorted array according to the sort instructions Function Description: You are given an MxN array of either numbers or characters. The second input tells you how to sort it. - The first character is the number of the column that you will be sorting by - The last character instructs you whether to sort in ascending ('A') or descending ('D') order Your function should return the given array with the rows sorted by the data in the indicated column.| Note(s): - The column to sort by will be less than or equal to N - The second input will always be formated as stated above Hint(s): - Use of the str2num(), sort() functions ny be helpful - to sort in ascending order you can type sort(blah,'ascend') or sort(blah,'a'). Similarly, you can sort in descending order by sort(blah,'descend') or sort(blah,' 'd') Examples: array =[ 'GBI'; 'AHC'; 'FED' ] criteria = '2A'; [ array ]= sortRows(array, criteria) array = 'GBI' 'FEDStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started