Thank you all for so many fast helps. After my network was fixed, I was bombed by so many suggestions. It seems that I must use at least 1 for loop and 1 case structure to get rid of NaN elements. Due to the data collection procedure, it is impossible to discard zero value from divisor array while collecting data. I am testing each solution and see which one can give me the fastest way to solve the problem. Thank you all again!