----------------------------------
clear all
close all
clc
param = [1 2];
options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,Y] = ode45(@rigid,[0 12],[0 1 1],options,param);
% Plotting the columns of the returned array Y versus T shows the solution
figure('color','w')
plot(T,Y(:,1),'-',T,Y(:,2),'-.',T,Y(:,3),'.')
----------------------------------
function dy = rigid(t, y, param)
% dy = zeros(3,1); % a column vector
dy1 = param' * y(2) * y(3);
dy2 = -y(1) .* y(3);
dy3 = -0.51 * y(1) .* y(2);
dy = [dy1'; dy2'; dy3'];