I believe your entire code can be replaced with 3 lines,
[x,y,z]=ndgrid(0:N);
fh=( c/2 ) * ( sqrt((x(:)/lx)^2 + (y(:)/ly)^2 + (z(:)/lz)^2));
b1=sum(fh<50 & fh>25)
No need for loops and if statements.
But to answer your question, you are not indexing the vector fh in your loop, so the entire vector quantity fh>50 is being given to the && operator. The && operator does not work with vectors and, even if it did, it's rare that you would want to give a vector expression to an if statement (I've never done it).
