Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using MATLAB, Modify the function mysort() below to sort this vector in ascending order based on the quiz average. vec quiz 2 id no 7.5
Using MATLAB, Modify the function mysort() below to sort this vector in ascending order based on the quiz average.
vec quiz 2 id no 7.5 5.5 6.5 37 24 4 Modify the function mysort() below to sort this vector in ascending order based on the quiz average. For example, if the vector stores the values shown above, this would be an example of calling mysort: >> sortvec = mysort (vec); >> for i = 1:4 fprintt('ad ave: %.1f ', mean sortveE( 1 ) . quiz ) ) sortvec(1). id-no, 3 ave: 6.0 24 ave: 7.0 ave: 7.5 7 ave:8.0 Your Function 1 function outvmysort(vec) 3 for i1:length(vec)-1 CReset MATLAB Documentation indlow i; for j-i+1: length(vec) if vecj)Step 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