Index exceeds matrix dimensions?
(M,N)=size(g2);s=0;
u=M*N;
mj=ones(1,u);
for i=1:M
for j=1:N
if g2(i,j)==0
s=s+1;
while g2(i,j)==0
g2(i,j)=s;
x=i+1;
y=j+1;
mj(1,s)=mj(1,s)+1;
while g2(x,j)==0
g2(x,j)=s;
x=x+1;
mj(1,s)=mj(1,s)+1;
end
while g2(i,y)==0
g2(i,y)=s;
y=y+1;
mj(1,s)=mj(1,s)+1;
end
if g2(i+1,j+1)==0
i=i+1;
j=j+1;
end
end
end
end
end
??? Index exceeds matrix dimensions.
这是什么问题 我最近才开始学习这个 菜鸟啊
[ 本帖最后由 ChaChing 于 2009-4-18 22:43 编辑 ] Ref
常见的程序出错问题整理 (eight)
http://forum.vibunion.com/forum/thread-46001-1-1.html
还有建议楼主看下本版规则! 标题要明确!
页:
[1]