plotPolygon

plotPolygon - % should plot each point in order. The shapes...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %======================================================================== % Problem 5. Plotting Simple Shapes %-------------------------------------------------------------------------- % % Problem Statement: % % Write a function called plotPolygon that will take in two vectors of the same % length and have no outputs. The first vector will contain the x values for the % polygon and the second vector will contain the y values. Your function
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % should plot each point in order. The shapes must be closed (the first % point must connect to the last point. % % % NOTE: Do NOT use the function "figure" in your code. This function causes % an error in the autograder and will result in a zero for this assignment. % function plotPolygon(x,y) hold on plot(x,y) i = length(x) x2 = [x(i),x(1)] y2 = [y(i),y(1)] plot(x2,y2) axis([(min(x)-2),(max(x)+2),(min(y)-2),(max(y)+2)])...
View Full Document

Ask a homework question - tutors are online