Integer indexing array: Weekend box office The row array movieBoxOffice stores the amount of money a movie makes (in millions of $) for the 7 days of a week, starting with Sunday. Write a statement that constructs a row array weekendBoxOffice having the values for Sunday, Friday, and Saturday. Ex: If movieBoxOffice is [5.6, 3.5, 1.1, 1.5, 0.8, 1.2, 1.9], then weekendBoxOffice is [5.6, 1.2, 1.9] Function Save Reset MATLAB DocumentationOpens in new tab function weekendBoxOffice = GetWeekendEarnings(movieBoxOffice) % movieBoxOffice : 7 day box office sales in millions, starting with Sunday % Assign Sunday, Friday, and Saturday box office % earnings to row array weekendBoxOffice weekendBoxOffice = 0; end 1 2 3 4 5 6 7 8 Code to call your function

Respuesta :

Answer:

function weekendBoxOffice = GetWeekendEarnings(movieBoxOffice)

    weekendBoxOffice = movieBoxOffice([1, 6,7]);

end

Explanation:

  • Create a function called GetWeekendEarnings() .
  • Create an array weekendBoxOffice that stores the sunday,friday, saturday sales .

Statements are elements of a programming language that indicate actions to be executed.

The required statement is: weekendBoxOffice = movieBoxOffice([1 67]);

From the question, we have the following highlights:

  • Array name: movieBoxOffice
  • Elements of Sundays, Fridays and Saturdays are represented by array indices 1, 6 and 7.
  • The variable that holds the required values is: weekendBoxOffice

So, the required statement is: weekendBoxOffice = movieBoxOffice([1 67]);

Read more about programming statements at:

https://brainly.com/question/22159805