[enter image description here][1]im working on my project and in the mean while i created a loop where i always get the error .I would appreciate if someone looks into this issue and help me out to complete my project
Subscript indices must either be real positive integers or logicals.
Error in testmatrix (line 10) c(i,j) = 0;
clc;
clear all;
a=imread('test1.tif');
[ap,bq]=size(a);
for q=1:320;
for p=1:240;
if a(ap,bq)==i && a(ap,bq+1)==j
c(i,j)=1;
else
c(i,j)=0;
end
end
end
c(i,j) must be equal to 1 of a(ap,bq)=0 and a(ap,bq+1) must be 1 else c(i,j) must be zero. But the above mentioned is the error i get. I cant the condition above.How do i overcome the error.