登录论坛

查看完整版本 : 求助以下的if语句


runforever
2009-04-02, 20:19
if r>=1
Pout(i)=rou(i)^(r-2);
elseif r<1
Pout(i)=rou(i)^(3*r-4)
end
其中rou=[1:10:100000];
r=1.5
编译时出现如下错误:
??? Subscript indices must either be real positive integers or logicals.

Error in ==> Pout_r at 18
Pout(i)=rou(i)^(r-2);
求教大侠

zhyanchao
2009-04-02, 21:44
应该是程序中的"i"没指出来吧

linkingoo
2009-04-03, 08:19
你的i初始值设成0了吧?