Your task is to take the above code, and insert comments (using the “%” symbol)...

90.2K

Verified Solution

Question

Mechanical Engineering

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;

Answer & Explanation Solved by verified expert
4.1 Ratings (484 Votes)
close all closes all figures clear all clears workspace clc clear command window thetaAB 0 initialize variable thetaAB 0 angleIncrement 01 The data will be taken for each increment angle of 01 numOfLoops 360angleIncrement The number of times the for loop will be executed 36001 3600 thetaABVector angleIncrementangleIncrement360 Creates an array named    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students