Exercise 1.14: Array operations

Give an one line command that, for an array $ a$ , determines the number of elements in $ a$ which are greater than 5.

Test your command with the following arrays:
a)
a = [1 2 3; 4 5 6; 7 8 9]
b)
a = 1:10
c)
a = 10*rand(6,6)
PAY ATTENTION: The same command must work in all three cases!



Previous      Next      Up      Answer


Esteur 2010-03-22