Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help with this Computer science problem. Please use mathlab, thank you in advance. I. Problem Solving and Programming using MATLAB Functions and Scripts
Can someone help with this Computer science problem. Please use mathlab, thank you in advance.
I. Problem Solving and Programming using MATLAB Functions and Scripts (5 questions): write 1. points) Custom MATLAB function problem Convert the given script into a MATLAB function called Car2Pol Name with 2 inputs (x and y and 2 outputs (rand a that converts x and y Cartesian Crectangular) coordinates into the polar coordinate values: r radius of a circle with center at the origin (0,0) and a angle in degrees from the positive horizontal x axis to the current location in a counterclockwise direction. Clear Previous clear: cle (x,y Center 0 0 of the circle at the 11 Center r1)P ecarponent of the center Center (21 EY-component of the center 13 ax acost(x-h)/r) 180/pi: degree angle using x ay asin (ty k)/2) 180/pi: degree angle using 3 angie degrees if y 0 a IEO abs(ay) elae 360 day. 2E dispett are and disp th the puts tare. Rnd 2 (a) degrees. Command Window If the inputs are: x 3 and y 3.6056 and a 156.3099 degrees then the outputs aze: Question 1: LA,B] Rec2Pol-Name (17 -2],[7 4]); What are the values of A and B? 2 (30 points) Using the custom MATLAB function in a script and Animation problem write a MATLAB script called RAAnim ame to plot a graph of radius (y-axis) versus angle (x-axis utilizing the custom function made in problem #1 (Car2Pol Name) Animate a moving point and its trace line starting from initial to final x and y values. Ensure that the custom function can handle vector inputs, and for inputs the outputs should also be vectors (make sure to use the dot operator for exponentiation (A) multiplication and division D and use a For Loop for the If Conditional Statement to solve for the output angle a). Use the following ve inputsStep 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