Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 5 - Arrays Function Name: sportsstats Inputs 1. 2. (double) An Nx5 array representing the stats of different football teams (double) The cutoff for

image text in transcribed

Homework 5 - Arrays Function Name: sportsstats Inputs 1. 2. (double) An Nx5 array representing the stats of different football teams (double) The cutoff for total penalties Outputs 1. (double) An Mx5 array representing the updated stats Background You just finished watching the Patriots defeat the Rams in Super Bowl LIlI, and you just can't wait for the next season to start. However, instead of waiting around for the next football season, you decide to take matters into your own hands and create a MATLAB function that will determine which teams will be among the top competitors for the Super Bowl LIV ring Function Description You will be given an Nx5 array of stats, with each row representing an NFL team. Each of the columns wl represent, from left to right, the following:1 Average points per game, 2) Average rushing yards per game, 3) Average passing yards per game, 4) Total number of first downs, and 5) Total number of penalties. In order to thoroughly analyze these teams, you must make the following changes to the stats array: 1. Append a new column to the right of the array that contains the average total yards per 2. 3. 4. 5. Remove the bottom half of the teams from the array, so you are left with the teams with game, calculated by adding together the average rushing yards and average passing yards Remove all teams with a total number of penalties higher than the given cutoff Remove the column representing the total number of first downs Sort the rows in descending order by the average number of points per game the best points per game Example PPG ARY APY FD P 26.8 96.3 313.0 378 111 25.1 126.3 236.3 333 105 20.3 103.8 223.5 325 94 26.3 121.1 222.8 331 97] >> stats >cutoff 105 >> newStats sportsStats (stats, cutoff) PPG ARY APY P ATY >newstats - 26.3 121.1 222.8 97 343.9 25.1 126.3 236.3 105 362.6]

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago