Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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' 'FED

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

I am paid fairly for the work I do.

Answered: 1 week ago

Question

I receive the training I need to do my job well.

Answered: 1 week ago