MATLAB: Retrieving coordinates from rectangle function coordinatesellipserectangle function Dear all, Using the rectangle function, I am generating an ellipse. Is it possible to retrieve the corresponding x and y coordinates of this shape? Best Answer Solved the problem by defining the ellipse as a sine and cosine function, instead of the rectangle function. Related SolutionsMATLAB: Generate coordinates circle,square,rectangle For circle and ellipse, see the FAQ for code examples: http://matlab.wikia.com/wiki/FAQ?title=FAQ&cb=7341#How_do_I_create_a_circle.3FFor a square or rectangle, if you have x1, x2, y1, and y2, you can make it with plot by making coordinates of the box and calling plotxBox = [x1 x2 x2 x1 x1];yBox = [y1 y1 y2 y2 y1];plot(xBox, yBox, 'r-', 'LineWidth', 2);Of course that can ge generalized to any polygon, just list all the vertices. MATLAB: Cartesian to polar cordinate’ use cart2pol function Related QuestionTo retrieve height and width of rectangle drawnGenerate grid and coordinates in a rectangle
Best Answer