Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ng malemah suuh Beans 1. Programming using MATLAB GUIDE writeand save the folowi

ID: 3582006 • Letter: N

Question

ng malemah suuh Beans 1. Programming using MATLAB GUIDE writeand save the folowing mand fiefiles dsend as 1. (65 points) create a GUI Program called My Polygon Maker that displays an image of a polygon, inscribed in a circle with desired number of edges (sides) and color. program also shows the name of the polygon, and computes the total internal angle (n terms of m radians) and the percent area covered within the circle. Itshould contain the following objects (total of 10 objects) as illustrated below. Save as Make Polygon ame m and fig. 7 Static Texts 1 Pop-up Menu The Static Texts label the program and the title and author (your) information, Text is where total internal covered area), and show the computed values. The Edit user enters the desired number of edges or polygon. The Pop- up Menu lists the color options: red, green, blue, and random (color). The figure file can be formatted initially as displayed below. Running the program hence displays atriangle.

Explanation / Answer

function [x, y, dt] = simple_polygon(numSides) if numSides < 3 x = []; y = []; dt = DelaunayTri(); return end oldState = warning('off', 'MATLAB:TriRep:PtsNotInTriWarnId'); fudge = ceil(numSides/10); x = rand(numSides+fudge, 1); y = rand(numSides+fudge, 1); dt = DelaunayTri(x, y); boundaryEdges = freeBoundary(dt); numEdges = size(boundaryEdges, 1); while numEdges ~= numSides if numEdges > numSides triIndex = vertexAttachments(dt, boundaryEdges(:,1)); triIndex = triIndex(randperm(numel(triIndex))); keep = (cellfun('size', triIndex, 2) ~= 1); end if (numEdges