Info

此问题已关闭。 请重新打开它进行编辑或回答。

Hii all,As I had earlier having issues with array size,I tried to resolve it;but again I m getting error message in the line "f0(i,1)=f​profit(x0(​i,:));"

1 次查看(过去 30 天)
m=4;
n=100;
wmax=0.9
wmin=0.4
c1=2;
c2=2;
maxite=1000;
maxrun=10;
for run=1:maxrun
for i=1:n
for j=1:m
x0(i,j)=round(LB(j)+rand()*(UB(j)-LB(j)));
end
end
x=x0;
v=0.1*x0;
for i=1:n
f0(i,1)=fprofit(x0(i,:));
end
  2 个评论
Alex Mcaulley
Alex Mcaulley 2019-6-13
编辑:Alex Mcaulley 2019-6-13
What are LB, UB, fprofit?
What is the reason of using this loop? You don't use variable run for anything...
for run=1:maxrun
What is the complete error message?
By the way, in this line:
f0(i,1)=fprofit(x0(i,:));
you are assigning an array to a scalar

回答(0 个)

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by