if true
% code
close all;
clear all;
clc;
angleIncrement = 10;
numOfLoops = 360/angleIncrement;
thetaABVector = [angleIncrement:angleIncrement:360];
prompt = 'Please enter a whole number value for rAB ';
rAB = input(prompt)
prompt = 'Please enter a whole number value for rBC';
rBC = input(prompt)
prompt ='Please enter a whole number value for thetaAB';
thetaAB= input(prompt)
prompt= 'Please enter a whole number value for omegaAB';
omegaAB= input(prompt);
prompt= 'Please enter a whole number value for alphaAB';
alphaAB= input(prompt);
for i=1:numOfLoops
bothResults = SliderCrankAcc2(rAB,rBC,thetaAB, omegaAB, alphaAB);
rAC(i) = bothResults(1);
thetaBC(i) = bothResults(2);
thetaAB = thetaAB+angleIncrement;
end
subplot(2,1,1) %parameters of the plot graph
plot(thetaABVector,thetaBC,'Linewidth',3); %plot thetaABVector, thetaBC with a linewidth of 3 making is bolder and fatter.
xlabel('\theta_{AB} [degrees]'); %lable the x-axis of the first plot to be thetaAB degrees
ylabel('\theta_{BC} [degrees]'); %lable the y-axis of the first plot to be thetaBC degrees
xlim([0 360]); %limits in the x-axis between 0 and 360
ylim([300 400]); %limits in the y-axis to be between 300 and 400
grid on; %turn the grid on to see lines
subplot(2,1,2) %create a two 2x1 graphs
plot(thetaABVector,rAC,'r'); %plot thetaABVector in the second graph in terms of position
xlabel('\theta_{AB} [degrees]'); %lable the x-axis in terms of degrees and lable it theta AB degrees
ylabel('r_{AC} [inches]'); %lable y-axis in terms of postion and call it rAC inches
xlim([0 360]); %set a limit for x-variables to be between 0 and 360
grid on; %Turn gridlines on for the second plot
end
