%=========== CDA6530, Fall 2010 ========================
%========= Project 2, Question 1 =======================
%This file shows how to output simulink signals with 
%variable simulation steps. 
%===== The simulink model: project2_q1.mdl ==========
m=0.25; c=0.5; k=1;
sim('project2_q1_model');  % the simulation end time: 10.
% the "to workspace" use "-1" for sample time (inherited)
% the save format is "structure with time".
% workspace variable is X_t.

% X_t.time saves the simulation step times
% X_t.signals.values saves the simulation results.
plot(X_t.time, X_t.signals.values, '-^');