You are reporting the paste Only integer scalar arrays can be converted to a scalar index.