Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB problem. Would like a detailed answer line by line. A 300 lb. garage door

ID: 3120374 • Letter: M

Question

MATLAB problem. Would like a detailed answer line by line.

A 300 lb. garage door is opened by pulling on the cable as shown. As the door is lifted, the force F in the cable, as a function of the angle theta, is given by: F = 300(4.5 sin theta)/3 cos(alpha - theta) where 1 + 3 cos theta/Squareroot (1 + 3 cos theta)^2 (3 - 3 sin theta)^2 Write a script file to calculate F for theta - 0 degree through 90 degree in increments of 10 degree. Use the disp () function to display the results in two-column table as shown. Theta(deg) F(lb) X.X X.X Where X. X are the values of theta and F displayed in the table.

Explanation / Answer

% MATLAB code

n=9; % no. of intervals

a = 0; % lower limit of interval in degrees

b = 90; % upper limit of interval in degrees

xd = zeros(0:1:n) % initializing all the theta values in degrees to zero.

xr = zeros(0:1:n) % initializing all the theta values in radians to zero

y = zeros(0:1:n) % initializing all the alpha values to zero

F = zeros(0:1:n) % initializing all the force values to zero.

xd[0] = a; % setting the start of interval to 0

h = ((b-a)/n);

for i=1:n

xd[i] = (xd[i-1] + h);

end

for i = 0:1:n

xr[i] = xd[i] * pi/180;

y[i] = arcsin((1+3cos(xr[i]))/sqrt((1+3cos(xr[i]))^2 + (3-3sin(xr[i]))^2));

F[i] = (300*4.5(sin(xr[i]))/(3cos(y[i]-xr[i]));

Theta[i] = xd[i];

end

T = table(Theta, F);

disp(T);