] plot the displacements in meters for all the 3 masses for time 0 to 300 s. in matlab

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.m
plot(time, disp1, time, disp2, time, disp3)
xlabel('Time (s)')
ylabel('Displacement (m)')
legend('Mass 1', 'Mass 2', 'Mass 3')
127 chars
5 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.

related categories

gistlibby LogSnag