MATLAB: Sum of vector involving relational operations

relational operationssumvector

When given something such as
x=[0:.5:10]'
why does
sum(x>8 & x<=4) = 0

Best Answer

Think about it. Here no ‘x’ can simultaneously be >8 and <=4.