Question: MATLAB QUESTION Write an M-file program that will compute and plot the distance traveled by the piston as a function of the angle, A, for
MATLAB QUESTION
Write an M-file program that will compute and plot the distance traveled by the piston as a function of the angle, A, for given lengths of L_1 and L_2. The L_1 and L_2 are to be input from the matlab command window. The angle A will go from 0 to 180 degrees by increments of 0.5 degrees. For your plot, label the x-axis as "A in degrees", the y-axis "distance in feet" and make the title, "Piston Distance". You will plot d vs A. We know from trigonometry that d = L_1 cos(B) + L_2 cos(A) And from the law of sines: sin(A)/L_1 = sin(B)/L_2 (Use this to find B) When you run the program use L_1 = 1.5 foot, and L_2 = 0.75 feet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
