Update Array - I want to move the value at TEMP through to an array and display it all possible values of temp.
1 次查看(过去 30 天)
显示 更早的评论
%disp('the parent objective values are');
for k=1:pop_size
temp=0;
temp1=0;
car=[]
obj(k)=0;
for i=1:n
temp1=temp1+Pg(k,i);
temp=temp+a(i)+b(i)*Pg(k,i)+c(i)*Pg(k,i)*Pg(k,i);
car=temp
end
temp2=Pd-temp1;
temp3=0;
if(temp2>0)
temp3=10.0*temp2;
end
obj(k)=temp+temp3;
% fprintf('fuelcost=%7.3f $\n',obj(k));
end
1 个评论
dpb
2019-8-25
No idea what you mean, sorry.
Show us a sample set of data and what you want output to be.
There are too many missing/undefined variables in the above code snippet to do anything with.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!