Hello everyone I am working with MATLAB and I am having some trouble with my assignment.
I have to:
Create a sub-function that will create a list of x and y values that represent the vertices of a random polygon. The input to the function will be the number of vertices. The x and y data should range from -0.5 to 0.5.
Create a sub-function that takes as input the x and y values of a polygon and 'closes' it - i.e. makes the last point the same as the first point.
Create a sub-function that takes as input the x and y values of a closed polygon along with a linetype specifier and an 'iteration number' (I) and plots it with connecting lines and markers at the vertices. The title of the plot should indicate the number of points for the polygon and the iteration number. X and Y axis labels are not required. Pause for (1/I) seconds after plotting.
I am having trouble with creating my main function I am not sure how to generate these values. I tried using linspace but then I couldn't really figure how to make that first sub-function. Any help is much appreciated. Thank you all for your time.