MATLAB: Matlab help needed please

Im trying to solve a system of ode's
dx/dt = alpha(x) – beta (xy) dy/dt = gamma (xy) – delta(y)
where alpha beta gamma and delta are known variables (1,2,4,3) and x0= 1, y0 = 2 this is my code so far:
% code
syms f(t) g(t)
eqn1 = diff(f) == 1*f - 2*f*g;
eqn2 = diff(g) == 4*f*g - 3*g;
S = dsolve(eqn1, eqn2)
[fSol(t), gSol(t)] = dsolve(eqn1, eqn2)
c1 = f(0) == 1;
c2 = g(0) == 2;
[fSol(t), gSol(t)] = dsolve(eqn1, eqn2, c1, c2)
fplot(fSol)
hold on
fplot(gSol)
grid on
legend('fSol','gSol','Location','best')
end
matlab keeps giving the the error 'explicit solution could not be found'

Best Answer

Your differential equations are nonlinear. Very few nonlinear differential equations have analytic solutions. Yours are not among them. You have to integrate them numerically.
The Code
syms f(t) g(t)
eqn1 = diff(f) == 1*f - 2*f*g;
eqn2 = diff(g) == 4*f*g - 3*g;
S = odeToVectorField(eqn1, eqn2);
Sfcn = matlabFunction(S);
tspan = linspace(0, 10, 250);
S0 = [2; 1];
[t,gf] = ode15s(@(t,Y) Sfcn(Y), tspan, S0);
figure(1)
plot(t, gf)
grid
legend('g(t)', 'f(t)')
xlabel('Time')
ylabel('Amplitude')
The Plot