%% File Instead of Function Handle
%% 1

syms x(t) y(t)
eqs = [diff(x(t), t) + 2*diff(y(t), t) == 0.1*y(t), ...
       x(t) - y(t) == cos(t) - 0.2*t*sin(x(t))];
vars = [x(t), y(t)];
[M, F] = massMatrixForm(eqs, vars)
M = odeFunction(M, vars);
F = odeFunction(F, vars);
xy0 = [2; 1];
xyp0 = [0; 0.05*xy0(2)];
opt = odeset('mass',M, 'RelTol', 10^(-6), 'AbsTol', 10^(-6), 'InitialSlope', xyp0);

%
%% 2

ode15s(F, [0 7], xy0, opt)

% Copyright 2012 The MathWorks, Inc.