Your problem is most likely in a part of your code you did not post. Thus, it would be easier if you post also the assignment to
N rather than just stating you defined it. For instance, this code fails with the error you report:
N = 100.
Z = zeros(N+1, N+1);
The difference is in the trailing dot after "100", which makes it a floating point number. And you cant use a floating point number in
zeros, you need an Int.