Question
I need to make a program that gives me the correct values for Theta1 and Theta2 while switching my L1,L2, X and Y values, the
I need to make a program that gives me the correct values for Theta1 and Theta2 while switching my "L1,L2, X and Y values", the program shown below keeps giving me the same values for the Thetas even if I change the mention parameters (L1,L2,X and Y). Basically, I just need a program that gives me Theta1 and Theta2 based on (L1,L2, X and Y Parameters), Suppose these parameters are
L1=20, L2=25, X=10, Y=20
MATLAB CODE:
function myfunction(L1,L2,X,Y) THETA1=0; THETA2=0; for i=0:1800 for j=0:3600 XP=L2*cosd(THETA1+THETA2)+L1*cosd(THETA1); YP=L2*sind(THETA1+THETA2)+L1*sind(THETA1); if(X-XP)<0.01&&(Y-YP)<0.01; i=1801; j=3601; end THETA2=THETA2+0.1; end THETA1=THETA1+0.1; THETA2=0; end THETA1 THETA2 end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started