%% Define the initial state and a time vector for simulation
state0 = [0.0, 0.0]; % position, velocity
t = 0:.1:10;         % time

%% Run the simulation
[t,state] = ode45('MassSpring', t, state0);


%% Plot the results
plot(t, state)
xlabel('TIME (sec)')
ylabel('STATES')
title('Mass-Spring System')
legend({'$x$ (m)', '$\dot{x}$ (m/sec)'},'interpreter','latex')
