Personal Website:
Scott Congreve

Teaching

Download<< Back

function run_catmouseevents
vm = 1;
vc = 2;
x0 = [1;1];

options = odeset('Events',@(t, x) catmouseevents(t, x, vm));
[t,x,te,xe,ie] = ode23(@(t,x) catmouse(t, x, vm, vc), [0, 1/vm], x0, options);
te,xe,ie

figure;
plot(x(:,1), x(:,2), x(1,1), x(1,2), 'o');
xlabel('x_1', 'FontSize',18);
ylabel('x_2', 'FontSize',18);