MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   【求助】关于元胞数组能否用于循环数组程序 (https://www.labfans.com/bbs/showthread.php?t=1195)

vikki1995 2008-01-09 18:51

【求助】关于元胞数组能否用于循环数组程序
 
关于元胞数组能否用于循环数组程序,请教各位高手。

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.

fanxing39 2008-01-10 12:06

[QUOTE=vikki1995;4645]关于元胞数组能否用于循环数组程序,请教各位高手。

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)
en...[/QUOTE]

你的程序格式不正确导致的.
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
[COLOR="Red"][SIZE="4"]注意: 我只改了错误的格式,至于这2个命令要做什么因为不清楚,所以程序运行肯定出错. 请只参考 命令格式. [/SIZE][/COLOR]


所有时间均为北京时间。现在的时间是 09:44

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