在使用箭袋绘图时,我无法按照需要显示图例。我正在使用R2017a。
% Some parameters
k1 = 1;
k2 = 1;
k3 = 10;
E = 10;
% establish the grid of possible C and S values
[cmesh,smesh] = meshgrid(0:0.5:10,0:0.5:10);
% Calculate nullcine and the tendencies at each value of the grid
cnull = k1.*E.*smesh./(k1.*smesh + k2 + k3);
dsdt = -k1.*(E - cmesh).*smesh + k2.*cmesh;
dcdt = k1.*(E - cmesh).*smesh - (k2 + k3).*cmesh;
% Plot the phase plane
quiver(smesh,cmesh,dsdt,dcdt);
hold on;
plot(smesh, cnull);
hold on;
plot([1:10],[1:10]);
legend('Trajectory', 'C nullcline', 'S(t),C(t)');
xlabel('S');
ylabel('C');
axis([0,10,0,10]);
title('Phase Plane');
线条颜色与创建的图形中的绘制线条不匹配。