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.

Antworten (1)

Image Analyst
Image Analyst am 19 Okt. 2018

0 Stimmen

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().

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 19 Okt. 2018

Beantwortet:

am 19 Okt. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by