Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

define constraint function with matlab

medk10medk10 Posts: 2Member
Good evening, i want to define the following joined function and call it in the main programme.
i try this :
[code]
for k1=1:3;
for k2=1:3;
for e1=1:10;
for e2=1:10;
e1~=e2;
z(k1,e1)=tabaffes(k1,e1)*tabaffes(k2,e2);
z(k1,e1)<=tabaffes(k1,e1);
z(k1,e1)<=tabaffes(k2,e2);
z(k1,e1)>=tabaffes(k1,e1)+tabaffes(k2,e2)-1;
z(k1,e1)>=0;
tabaffee(e1,e2)=sum(z(k1,e1));
F=sum(sum(coutl(k1,e1))*tabaffes(k1,e1))+sum(sum((couth(e1,e2))*(1-tabaffee(e1,e2))));
disp(F);
end
end
end
end
[/code]
and in the main programme:
[code]
F=soleval(SB,it_max);
[/code]
but that give me always the same result then i would like to have a variety of results , thank you for helping me in this stuff.

Sign In or Register to comment.