Guide to Matlab Programming (Supplement)

To plot the velocity versus position, one can do the following,

1. Create matrix C1 so that the system output is position;

2. Create matrix C2 so that the system output is velocity;

3. Use the following command to obtain the outputs (After the systems, inputs, initial conditions and the time intervals are obtained with the procedure described before),

y1 = lsim(system1, U, T, x0); y2 = lsim(system2, U, T, x0);

4. Plot velocity versus position with the command,
plot(y1,y2)