Question: Write a Matlab function ( CircleData . m ) that takes either 3 or 4 arguments and returns two arrays. The arguments are the and
Write a Matlab function CircleDatam that takes either or arguments and returns two arrays. The arguments are the and coordinates of the center of a circle, the radius r of the circle, and the number of points n on the circle. The last argument is optional and if it is not given, assume that it is The function should create a list of n equallyspaced angle values ranging from to pi Then, for each angle value, the x and ycoordinates of a point on the circle will be
x r cosangle
y r sinangle
The function script must return the lists of x and y values in the two output arguments. What you submit should only have the function script and not any test code.
To make sure your function script is working properly, you can test your function outside of that script using the plotting features discussed in lecture. For example
xy CircleData;
plotxy;
grid on;
axis equal;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
