MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   求助以下的if语句 (https://www.labfans.com/bbs/showthread.php?t=7279)

runforever 2009-04-02 20:19

求助以下的if语句
 
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

回复: 求助以下的if语句
 
应该是程序中的"i"没指出来吧

linkingoo 2009-04-03 08:19

回复: 求助以下的if语句
 
你的i初始值设成0了吧?


所有时间均为北京时间。现在的时间是 03:26

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