Your task is to take the above code, and insert comments (using the “%†symbol) next to each line of code to make sure that you know what every line does.close all;clear all;clc;
thetaAB = 0;angleIncrement = 0.1;numOfLoops = 360/angleIncrement;thetaABVector = [angleIncrement:angleIncrement:360];rAB = 5;rBC = 8;
for i=1:numOfLoops bothResults = SliderCrankPosn(rAB,rBC,thetaAB); rAC(i) = bothResults(1); thetaBC(i) = bothResults(2); thetaAB = thetaAB+angleIncrement;
end
subplot(2,1,1)plot(thetaABVector,thetaBC,'Linewidth',3);xlabel('\theta_{AB} [degrees]');ylabel('\theta_{BC} [degrees]');xlim([0 360]);ylim([300 400]);grid on;
subplot(2,1,2)plot(thetaABVector,rAC,'r');xlabel('\theta_{AB} [degrees]');ylabel('r_{AC} [inches]');xlim([0 360]);grid on;