function predprey

    global a1 a2 b1 b2 c1 K ep modl

    modl = 3;
    switch modl
        case 1
            a1 = 1;
            a2 = 2;
            b1 = 3;
            b2 = 4;
        case 2
            a1 = 1;
            a2 = 2;
            ep = 1;
            b1 = 3;
            b2 = 4;
        case 3
            a1 = 10;
            a2 = 1;
            K  = 1;
            b1 = 100;
            b2 = 1;
            c1 = 10;
    end

    X0 = [1;1];
    tspan = [0,10];
    opts = odeset('RelTol',1.0e-10);
    [t,X] = ode45(@rb,tspan,X0,opts);

    subplot(1,2,1)
    plot(t,X(:,1),'r',t,X(:,2),'g')
    xlabel('Zeit'); ylabel('Anzahl der Individuen');
    subplot(1,2,2)
    plot(X(:,1),X(:,2))
    xlabel('Beute'); ylabel('Raeuber');

end

function dX = rb(t,X)

    global a1 a2 b1 b2 c1 K ep modl

    x  = X(1);
    y  = X(2);

    switch modl
        case 1
            dX1 = (a1-b1*y)*x;
            dX2 = (b2*x-a2)*y;;
        case 2
            dX1 = a1*(1-ep*x)-b1*x*y;
            dX2 = (b2*x-a2)*y;
        case 3
            dX1 = a1*x.*(1-x/K) - b1*x*y/(1+c1*x);
            dX2 = a2*y.*(1-y./(b2*x));
    end

    dX = [dX1;dX2];

end
