关于matlab中的if问题

来源:百度知道 编辑:UC知道 时间:2024/05/18 04:38:39
Count=length(find(Q<=8.94));
if Count=1
net1=newff([0 100],[500,1],{'logsig','purelin'},'traincgf');
[net1,tr]=train(net1,p,t);
else if Count=2
net2=newff([0 100],[500,2],{'logsig','purelin'},'traincgf');
[net2,tr]=train(net2,p,t);
else if Count=3
net3=newff([0 100],[500,3],{'logsig','purelin'},'traincgf');
[net3,tr]=train(net3,p,t);
else Count=4
net4=newff([0 100],[500,4],{'logsig','purelin'},'traincgf');
[net4,tr]=train(net4,p,t);
end
end
end
这是我的程序的其中一段,Count可能取值为1,2,3,4,每次运行都会出现这样的错误,请问我应该怎么改?
if Count=1
|
Error: The expression to the left of the equals sign is not a valid target for an assignment.

Count=length(find(Q<=8.94));
if Count==1 %等号是“==”啊,以下相同
net1=newff([0 100],[500,1],{'logsig','purelin'},'traincgf');
[net1,tr]=train(net1,p,t);
else if Count==2
net2=newff([0 100],[500,2],{'logsig','purelin'},'traincgf');
[net2,tr]=train(net2,p,t);
else if Count==3
net3=newff([0 100],[500,3],{'logsig','purelin'},'traincgf');
[net3,tr]=train(net3,p,t);
else Count==4
net4=newff([0 100],[500,4],{'logsig','purelin'},'traincgf');
[net4,tr]=train(net4,p,t);
end
end
end