MATLAB: Error when I execute RGB scrambling

arnold's cat maprgb scramblingsubscript indices must either be real positive integers or logicals.

I want to do RGB scrambling as part of image cryptography. While executing a code, I got an error message
"Subscript indices must either be real positive integers or logicals".
The code is given below;
iscram=cipher;
N=256;
T=1.4938*N+40.8689;
disp(T);
t=0;
T2=ceil(T);
disp(T2);
c=[T];
while t<T2
for i=[0:N-1]
for j=[0:N-1]
iscram(i,j)=iscram(mod(i+j,N),mod(i+(2*j),N));
end
end
t=t+1;
end
How do I solve this. Can anyone help me?

Best Answer

MATLAB subscript start at 1 not 0