How do I perform this operation

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 comentarios

Rik
Rik el 2 de Oct. de 2017
You can find guidelines for posting homework on this forum here.
Have a read here and here. It will greatly improve your chances of getting an answer.
It is unclear what your question is. Is it how to run this function? How to enter the data? How to load the data from some file or another?
Blair Hall
Blair Hall el 2 de Oct. de 2017
how to run it
Jan
Jan el 2 de Oct. de 2017
Editada: Jan el 2 de Oct. de 2017
@Blair: How to run what? Your question does not contain enough information to define clearly, what this function should do. "7 day box office sales in millions" might be a [1 x 7] vector, or a database connection, or Excel file, or a struct array containing the values for the last 12 years.
But when I remember the bunch of other questions you have posted in the last days, I imagine that again the solution is trivial. Perhaps weekendBoxOffice = movieBoxOffice([7,5,6]) ([EDITED] Note that I assumed, that the week begins on Monday). Well, even if I post the solution of a homework question with this, I need to point out again: This is not the right way to use the forum. You post your homework question without any own attempt or effort. This will not help you and therefore it is an inefficient use of time to post the answers. Please, Blair, stop this now.
Rik
Rik el 2 de Oct. de 2017
I agree with Jan on this one. You should really put in some effort of your own, otherwise you are using us as a solution machine. You won't learn to do anything on your own that way. This is also the reason that some homework questions are ignored.
I would advise you to look for a Matlab course that is not over the internet. I expect most universities will have something like that. It seems that you need some in-person assistance to get you going in understanding the way Matlab works.
Maybe it doesn't help either that you are not really running Matlab itself.
Blair Hall
Blair Hall el 2 de Oct. de 2017
Editada: Walter Roberson el 2 de Oct. de 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 el 2 de Oct. de 2017
@Blair: Did you read and understand the suggestions of Rik and me?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Etiquetas

Preguntada:

el 2 de Oct. de 2017

Editada:

el 2 de Oct. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by