Using functions DrawRect and DrawStar that you create, generate an image of the
ID: 3530042 • Letter: U
Question
Using functions DrawRect and DrawStar that you create, generate an image of the first American flag, shown belowNotice that Matlab may not align your image with the axes perfectly. This is fine, eventually you'll learn to tweak your plots so that image elements and coordinate axes and axes' labels are in perfect agreement for professional-looking presentations. For this assignment just create a flag image with dimensions of 7 units wide by 5 units high and let Matlab define the axes however it sees fit.
You should use an implementation for DrawRect similar to what we saw in lecture. For DrawStar things get a little more complicated. Define a function that takes three inputs:
1. An array with two elements specifying the location in the figure of the center of the star.
2. A single value specifying the length L of one of the arms of the star (see figure below).
3. A variable for the color of the star. For this assignment we will always pass in the value 'w' for white.
Note that the star is just a polygon with ten evenly spaced vertices. The five outer vertices are a distance L from the center of the star and the five inner vertices are L' = 0.4L from the center of the star. As with any polygon, all you need to do to draw the star is to call the fill function with the correct x and y array values describing the vertex locations. For example, the top vertex of the star is at the location [a b+L].The stars should be positioned on a circle centered in the blue field. Make the length L for each star equal to at least 0.1.
Explanation / Answer
I' ll try to help you,give me sometime This is first time i am answering some question
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.