Code covered by the BSD License  

Highlights from
MATLAB in Physics - Visualisation

image thumbnail
from MATLAB in Physics - Visualisation by Matt McDonnell
The first lecture in a series on using MATLABĀ® in undergraduate physics courses.

plotTimeSeries(res)
function plotTimeSeries(res)
% Plot the time series representation of simple harmonic motion

%   Copyright 2008-2009 The MathWorks, Inc.

% res struct has fields Position, Time

plot(res.Time, res.Position, 'b.-')
xlabel('Time (s)');
ylabel('Position');

Contact us at files@mathworks.com