How to check for condition without using a loop or if statement.

The problem set up is this: Given vector A, and the average value of the elements in vector A, track the number of times an element in vector A is greater than the average value of elements in A.
The issue is that I'm not allowed to use a loop or and if statement.

Respuestas (1)

Image Analyst
Image Analyst el 19 de Oct. de 2018
Since it's homework, we can't give you the answer outright. So read this link: http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers
Hint: use mean(), the greater than symbol, and sum().

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 19 de Oct. de 2018

Respondida:

el 19 de Oct. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by