Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2007-07-17
帖子: 11
声望力: 18 ![]() |
![]()
关于元胞数组能否用于循环数组程序,请教各位高手。
for e=1:1:10 ljhist{e}(1)=i{e}(1) end for e=1:1:10 for f=1:1:15 ljhist{e}(f+1)=ljhist{e}(f)+i{e}(f+1) end end 这样行不行,请大家帮忙看看,谢谢。 运行问题 The variable "ljhist" is also the name of this script. This is illegal, because it will be the name of a script and a variable in any context from which the script is called. |
![]() |
![]() |
![]() |
#2 | |
高级会员
注册日期: 2007-12-02
年龄: 44
帖子: 303
声望力: 31 ![]() ![]() ![]() ![]() |
![]() 引用:
for e=1:10 ljhist(e,1)=i*e(1) %这个i是什么意思? 是数值吗? end for e=1:10 for f=1:15 ljhist(e,f+1)=ljhist(e,f)+i(e,f+1); end end 注意: 我只改了错误的格式,至于这2个命令要做什么因为不清楚,所以程序运行肯定出错. 请只参考 命令格式. |
|
![]() |
![]() |