Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for matlab Function Name: goLong Inputs: 1. (char) An NxM array representing the field before the pass Outputs: (char) An NxM array representing the field

for matlab

Function Name: goLong Inputs:

1. (char) An NxM array representing the field before the pass

Outputs:

  1. (char) An NxM array representing the field after the pass

  2. (double) The distance the pass traveled in yards

  3. (double) The distance the receiver ran in yards

Background:

With Atlanta getting in the Super Bowl spirit, you decide to volunteer for the Georgia Tech football team to help them with some advanced analytics. With the team dropping the triple option, the coaches want your help looking at some passing plays.

Function Description:

You will be given a character array that represents the field before the play is run. The character 'Q' will represent the quarterback, the character 'W' will represent the wide receiver, and the '*' characters will be the the path the wide receiver follows. Given this diagram, you will need to

  1. Figure out how far the receiver runs. Each '*' represents 1 yard.

  2. Update the diagram to show what it will look like once the play has been run with the

    wide receiver at the end of their route. The end of the wide receivers route will always

    be the '*' character closest to the top of the array.

  3. Determine how far the ball travels in the air, from the quarterback ('Q') to the wide

    receiver ('W'). Each index counts as one yard. The ball travels straight from the quarterback to the receiver, not necessarily along the rows and columns.

Example:

play=[' * ' ' ****' '*' '*'

'Q W']

>> [finalPlay, throwDist, runDist] = goLong(play) 

finalPlay = [' W ' throwDist = 4.47 runDist = 7 ' ****'

'*' '*' 'Q ']

Homework 5 - Arrays

Notes:

  • Round the throw distance to 2 decimal places.

  • There will only be one '*' on the row closest to the top (i.e. there will never be more

    than one ending location).

  • The background will always be spaces (' ').

    Hints:

  • The find() and sum() functions will be useful.

  • Remember the distance formula?

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

Address an envelope properly.

Answered: 1 week ago

Question

Discuss guidelines for ethical business communication.

Answered: 1 week ago