MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]continue entering statement (https://www.labfans.com/bbs/showthread.php?t=4903)

Iamlnx 2008-10-17 21:13

[求助]continue entering statement
 
写了m文件后直接运行时start旁显示状态是continue entering statement,不知咋回事?
软件是从迅雷上下的,7.0,是不是哪个设置出了问题,还有麻烦帮忙看一下这个程序哪错了
thanks


clc;clear;
a=[1,1,1,1];b=[0,0,0,0];
c=[1,0,1,0;1,1,0,0;1,0,0,1;1,0,0,0];
aaa=[];k=1;i=1;j=0;n=1;count=1;
aaa=[a];
while a~=[0,0,0,0]
while i<=4
cc=c(i,:);
i=i+1;
aa=a+(-1)^k*cc;
bb=b+(-1)^(k+1)*cc;
while count<=4
count=count+1
while aa(count)<0|bb(count)<0|aa(count)>1|bb(count)>1|(aa(3)==1&(aa(2)==1|aa(4)==1))|(bb(3)==1&(bb(2)==1|bb(4)==1))
i=i+1;
cc=c(i,:);
aa=a+(-1)^k*cc
bb=b+(-1)^(k+1)*cc;
count=1;
end
end
haha=1;
haha
while j<=n-1
if aa==aaa((4*j+1):(4*j+4))
break
else
a=aa;b=bb;aaa=[aaa,a];
a
(-1)^k*cc
b
end
j=j+1;
end
n=n+1;
end
j=0;i=1;
end

meteora1005 2008-10-19 17:14

回复: [求助]continue entering statement
 
你这个程序漏洞很多啊,首先while a~=[0,0,0,0]这句,判断语句是对标量的,你却对向量,还有while aa(count)<0|bb(count)<0|aa(count)>1|bb(count)>1|(aa(3)==1&(aa(2)==1|aa(4)==1))|(bb(3)==1&(bb(2)==1|bb(4)==1))
中的逻辑运算符都得写成双的,入&&和||,还有,(-1)^k*cc这个是不是也有错?是不是改为:
(-1).^(k*cc),再好好检查一下


所有时间均为北京时间。现在的时间是 05:10

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.