I am trying to write a code that uses two parametric equations of x and y, which depend on the variables theta1 and theta2. Then I have to produce a plot of x Vs y for a range of values of theta1 and theta2. I am stuck how can I do this?
Bellow is my current code to display the coordinate of this point defined by the parametric equations a and b (btw this code doesn't work for reasons that I do not understand). Now I have to use these functions to produce an array that will plot the x,y coordinates over a range of values of theta1 (20 to 80 deg in increments of 0,5) and of theta2 (90 to 30 deg in increments if 0,5).
Thanks in advance for any help! Started Matlab a few weeks ago 🙂 (I attached a screenshot of the question)
n1 = input('Enter θ1: '); n2 = input('Enter θ2: ');function a = first_calc(n1,n2) a = 0.6*cosd(n1) + 0.2*cosd(n1-n2);endfunction b = second_calc(n1,n2) b = 0.6*sind(n1) + 0.2*sind(n1-n2);endfprintf('The value for x is %g, and that of y is g%\n' a,b);
Best Answer