You are using 'x' to index into the column of your matrix 'N.B'. column indezes can only be integer values. You step x from 0.5 to 1 in steps of 0.001. That is not going to work...
Use different variables for the stepping value, and the index of the matrix.