How do I perform this operation

15 views (last 30 days)
Blair Hall
Blair Hall on 2 Oct 2017
Edited: Walter Roberson on 2 Oct 2017
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
  6 Comments
Blair Hall
Blair Hall on 2 Oct 2017
Edited: Walter Roberson on 2 Oct 2017
I have tried. I just reset it after I couldn't figure out how to do it. Here is the rest of the question.
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].
I originally tried weekendBoxOffice = [1, 6, 7]. The answer was weekendBoxOffice = movieBoxOffice([1,6,7])
Jan
Jan on 2 Oct 2017
@Blair: Did you read and understand the suggestions of Rik and me?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!