1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| t1i=30*pi/180;
t2i=0*pi/180;
t3i=-70*pi/180;
t4i=20*pi/180;
for va=1:N
fid=fopen('valk.txt','a+');
c=va;
fprintf(fid,'%i\n',c);
fclose(fid);
lb=[(-pi/180)+t1i,(-pi/180)+t2i,(-pi/180)+t3i,(-pi/180)+t4i];
ub=[(pi/180)+t1i ,(pi/180)+t2i ,(pi/180)+t3i ,(pi/180)+t4i];
t0=[(-pi/180)+t1i,(-pi/180)+t2i,(-pi/180)+t3i,(-pi/180)+t4i];
options = optimset('LargeScale','off');
[t,D] =fmincon(@fctobj,t0,[],[],[],[],lb,ub,@fctcon,options)
t1i=t(1);
t2i=t(2);
t3i=t(3);
t4i=t(4);
end |
Partager