1. Engineering
  2. Computer Science
  3. matlab question please please answer each and every part thank...

Question: matlab question please please answer each and every part thank...

Question details

Two distances are required to specify the location of a point relative to an origin in 2-D space: The horizontal and vertical distances (x, y) in Cartesian coordinates . . The radius and angle (r, theta) in polar coordinates It is relatively straightforward to compute Cartesian coordinates (x, y) on the bases of polar coordinates (r, theta). The reverse process is not so simple. The radius can be computed by the following formula: r x2 + y2. If the coordinates lie within the first or fourth quadrants (i.e., x > 0), then a simple formula can be used to compute theta: 6 tan-1(). The difficulty arises for other cases. A table is given below that summarizes the possibilities tan-ie)-π <0 <0 0 >0 Write a MATLAB function file that uses if...elseif structures to calculate r and theta asa function of x and y. Express the final results for theta in degrees. Name your file Hw2_4 lastnamefirstinitial.m and set up the function such that it can be called by the following command: [r, theta]Hw2 4 lastnamefirstinitial (x,y). Include a screenshot of your neatly formatted code and the test case output in your PDF file that you submit to Gradescope, and also upload your m-file to the Homework 2 dropbox in the Assignments area on Canvas

Matlab question please!

Please answer each and every part. Thank you very much.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution