Реферат: Оптимизация режимов движения судов с использованием MATLAB 5.0
[Lopt,I]=min(L);
X1=C(I);
X2=TM(J+1,1)+(xr-I)*deltt(J+1);
Pacn=[Lopt;X1;X2;X1+X2];
DD=[DD Pacn(1,:)];
RR=[RR Pacn];
CC=[CC Pacn(4,:)];
end
PP=[PP;DD(1,:)];
RRR=[RRR RR];
D=DD;
C=CC;
end
RRR=[GG RRR];
R12=RRR(:,1:N)
R23=RRR(:,N+1:2*N)
R34=RRR(:,2*N+1:3*N)
plot(R34(1,:),R34(4,:)),grid
Результат.
R12 =
Columns 1 through 7
1.4899 1.4647 1.4402 1.4164 1.3934 1.3710 1.3494
5.8600 5.9271 5.9942 6.0613 6.1283 6.1954 6.2625
2.7300 2.7300 2.7300 2.7300 2.7300 2.7300 2.7300
8.5900 8.6571 8.7242 8.7912 8.8583 8.9254 8.9925
Columns 8 through 14
1.3285 1.3083 1.2889 1.2703 1.2522 1.2343 1.2172
6.3296 6.3967 6.4638 6.5308 6.5308 6.5979 6.5979
2.7300 2.7300 2.7300 2.7300 2.7708 2.7708 2.8117