Question: please help me with this MATLAB problem 4) (OPTIONAL, 6 points) The robot arm from practice1 takes two angle positions to move to a certain
4) (OPTIONAL, 6 points) The robot arm from practice1 takes two angle positions to move to a certain point in x,y space. Recall the formulas Hand x 10cos(th1)10cos(th1+th2) and losin(th1) + 10sin(th1+th2) Le Elbow Motor where th1 and th2 are the angles of the base and elbow joint respectively Base Motor a) Using matlab, first make a FUNCTION file robotXY.m which contains the function [x, y]- robotXY( th1, th2) that receives the two angles as input arguments and returns the corresponding x,y position of the robot arm as output arguments b) Test your new function with the following statements at the command line x y robotXY( pi/2, pi/2 should return x-10, y +10 x y robotXY( pi/6, 2*pi/3) should return x -0, y +10 and correct any errors you might have c) Now make a new SCRIPT file robotPlotter.m that creates and draws the trajectory of the robot arm when th1 goes from pi/3 to -pi/3 and th2 goes from pi/2 to-pi/2. First construct the th1 and th2 vectors so they have the SAME NUMBER OF POINTS, then invoke x y robotXY(th1, th2) to generate the corresponding x,y vectors, then plot(x,y) to create the plot. ADD title and axis labels! Save the plot as robotPlot.jpg When you are finished, make a zip of your AS folder and upload it to the server. You should see your code and plots in the upload results page, if not, then redo or get help
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
