How do I perform this operation

조회 수: 15 (최근 30일)
Blair Hall
Blair Hall 2017년 10월 2일
편집: Walter Roberson 2017년 10월 2일
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
Blair Hall
Blair Hall 2017년 10월 2일
편집: Walter Roberson 2017년 10월 2일
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 2017년 10월 2일
@Blair: Did you read and understand the suggestions of Rik and me?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by