For the given input you have provided, either i orj (or both), which you are using as indices to In, are not positiveintegers.
Also, i and j are pre-defined to be the imaginary unit (i.e. square root of -1) in MATLAB, so (over-writing and) using them as indices is not generally suggested. You might want to change the name of the variables to avoid confusion.