Question: MATLAB help (a) Write a function polar2cart, saved in a function file polar2cart.m, or a Live function saved in a file polar2cart.mlx. Your function should

MATLAB help
(a) Write a function polar2cart, saved in a function file polar2cart.m, or a Live function saved in a file polar2cart.mlx. Your function should convert plane-polar coordinates (r.0) into Cartesian coordinates x-r cos and y-r sin (where is in Radians) It should be able to work when r and are vectors (of the same length as each other) containing more than one value, as well as when they are single numbers. If the function is called with two output variables, it should return the value of x in the first variable and the value of y in the second variable, whereas if it is called with only one output variable it should return a single array containing the r and y values in two rows or columns. (8) (b) Test your function works by writing a script or Live Script file to convert r[2, 3 and -[m/6, /4] to Cartesians i. with two output variables ii. with one output variable Omit the terminating semicolons to see the values printed out in the Command Window (or as output in a Live Script). There is no need to hand in anything showing the output produced; as long as your code produces it, you will get the marks. 3) (c) Include some text in your function so that if the user types help polar2cart (in the Command Window or in a script/Live Script file) they will be told what the function does and how to use it. {2) (a) Write a function polar2cart, saved in a function file polar2cart.m, or a Live function saved in a file polar2cart.mlx. Your function should convert plane-polar coordinates (r.0) into Cartesian coordinates x-r cos and y-r sin (where is in Radians) It should be able to work when r and are vectors (of the same length as each other) containing more than one value, as well as when they are single numbers. If the function is called with two output variables, it should return the value of x in the first variable and the value of y in the second variable, whereas if it is called with only one output variable it should return a single array containing the r and y values in two rows or columns. (8) (b) Test your function works by writing a script or Live Script file to convert r[2, 3 and -[m/6, /4] to Cartesians i. with two output variables ii. with one output variable Omit the terminating semicolons to see the values printed out in the Command Window (or as output in a Live Script). There is no need to hand in anything showing the output produced; as long as your code produces it, you will get the marks. 3) (c) Include some text in your function so that if the user types help polar2cart (in the Command Window or in a script/Live Script file) they will be told what the function does and how to use it. {2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
