How do I perform this operation

15 vues (au cours des 30 derniers jours)
Blair Hall
Blair Hall le 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 commentaires
Blair Hall
Blair Hall le 2 Oct 2017
Modifié(e) : Walter Roberson le 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 le 2 Oct 2017
@Blair: Did you read and understand the suggestions of Rik and me?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by