Skip to content

Instantly share code, notes, and snippets.

@Shitaro
Created November 25, 2015 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shitaro/9aa1161abfdb4dab1d75 to your computer and use it in GitHub Desktop.
Save Shitaro/9aa1161abfdb4dab1d75 to your computer and use it in GitHub Desktop.
線形系に従うロミオとジュリエットの恋の微分方程式
function main
[x, y] = meshgrid(-3:.5:3);
[R, J] = romeo_juliet(x, y);
%graph
quiver(x, y, R, J);
xlabel('R');
ylabel('J');
xlim([-3.5, 3.5]);
ylim([-3.5, 3.5]);
axis square;
grid on;
end
function [R,J] = romeo_juliet( x, y )
a = 2;
b = 1;
c = -1;
d = -2;
R = a * x + b * y;
J = c * x + d * y;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment