Question: for matlab please help Function Name: tierList Inputs: 1. (double) A 1xN vector of doubles representing the rankings of a character across different versions of

for matlab please help

Function Name: tierList

Inputs:

1. (double) A 1xN vector of doubles representing the rankings of a character across different versions of Super Smash Bros

Outputs:

  1. (double) A 1x(N-1) vector of doubles representing the changes in ranking

  2. (double) A 1x2 vector of doubles containing the indices of the best and worst rankings

Background:

You are a professional Smash Bros player who wants to always be up to date on the latest tier list so that you can choose the most awesomest character and be the very best. You also want to make sure that your friends wont be able to trick you into accidentally nerfing your Super Smash Bros powers by making you pick a bad character. It is your duty to beat them all every time, and so you turn to the only friend who would never betray you - MATLAB!

Function Description:

The input vector contains the ranking of a certain character in different versions of the Super Smash Bros game. If the third element of the input vector is a 5, that means that the character was the 5th best brawler in 3rd version of the game. First, find the character's changes in ranking from each version to the next version. Second, find the best and worst rankings that the character had over all the versions. The best ranking will be the lowest number and worst ranking will be the highest number. The second output should be the indices (or the version) at which the best and worst rankings occur, in that order.

Example:

 >> rankings = [1, 5, 2, 6, 9, 2]; >> [changes, bestWorst] = tierList(rankings) >> changes = [-4, 3, -4, -3, 7] >> bestWorst => [1, 5] 

Notes:

  • 1 is the highest ranking and larger numbers indicate lower rankings.

  • A positive change should indicate a rise in rankings and a negative change should

    indicate a fall in rankings.

  • The length of the rankings vector will always be at least 2.

  • The best and worst rankings will always be unique, meaning they will never repeat.

    Hints:

  • What do the second output of min and max mean?

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!