Question: Which statement using logical indices will result in an error?

  1. b = a(a ~= 11)
  2. b = a(a == 1)
  3. b = a(a>6 && a<9)
  4. b = a(a | 1)

Answer: The correct answer of the above question is Option C:b = a(a>6 && a<9)