Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2008-08-01, 18:36   #1
tolabfans
普通会员
 
注册日期: 2008-02-29
年龄: 44
帖子: 92
声望力: 19
tolabfans 正向着好的方向发展
默认 [求助]我也求助个小疑难

b=t(2)+t(4);
c=t(1)+t(3);

运行上面二句简单的代码,可以执行,可总是警告,不知为啥。

Warning: Integer operands are required for colon operator when used as index.

意思是:需要整数操作符当冒句用作index时,不知啥意思
tolabfans 当前离线   回复时引用此帖
旧 2008-08-01, 19:42   #2
tolabfans
普通会员
 
注册日期: 2008-02-29
年龄: 44
帖子: 92
声望力: 19
tolabfans 正向着好的方向发展
默认

Section 41: Integer Operands Are Required for Colon Operator When Used as Index
Warning: Integer operands are required for colon operator
when used as index.

Explanation:
You have used a noninteger value as one of the parameters (starting value, increment, or stopping value) for the colon ( operator when using it to create a vector of indices to reference into a function.

Common causes:
You performed computations to obtain the starting or stopping values for the indexing but the result of those computations was not exactly an integer.

Solution:
Modify the index computations using the FIX , FLOOR , CEIL , or ROUND functions to ensure that the indices are integers. You can test if a variable contains an integer by comparing the variable to the output of the ROUND function operating on that variable when MATLAB is in debug mode on the line containing the variable.

在网上找到一段英文说明,解决了。加个round即可
tolabfans 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码


相似的主题
主题 主题作者 版面 回复 最后发表
【求助】三维图形怎么旋转 不吃泡面的男人 MATLAB论坛 1 2008-05-16 18:09


所有时间均为北京时间。现在的时间是 12:47


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