Assuming the displacements of the masses are stored in three separate vectors disp1
, disp2
, and disp3
and the corresponding time values are stored in a vector time
, the displacements can be plot using the following MATLAB code:
main.m127 chars5 lines
This will create a plot with time on the x-axis and displacement on the y-axis, with each mass's displacement plotted using a different color. The legend will identify which line corresponds to each mass.
gistlibby LogSnag