Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 (CircleData.m) that takes either 3 or 4 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 100. The function should create a list of n equally-spaced angle values ranging from 0 to 2\pi . Then, for each angle value, the x- and y-coordinates of a point on the circle will be
x =+ r cos(angle)
y =+ r sin(angle)
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
[x,y]= CircleData(2,3,4);
plot(x,y);
grid on;
axis equal;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago