I'm trying to implement this first order ODE:
This is the current code I have written:
%set up the requirements
xval = linspace(-5, 5, 20);
vval = linspace(-5, 5, 20);
[x, v] = meshgrid(xval, vval);
dotx = NaN(size(x));
dotv = NaN(size(v));
for i = 1:numel(x)
dotx(i) = v(i);
dotv(i) = -x(i); %<--- not sure about this!
quiver(x, v, dotx, dotv, 'red');
axis equal manual;
However, I'm not sure if the phase map part is correct. Comments / suggestions?