((((MATLAB)))) !! Create a function called polygon that draws a polygon in a pol
ID: 2316205 • Letter: #
Question
((((MATLAB))))
!!
Create a function called polygon that draws a polygon in a polar plot. Your function should have a single input parameter-the? number of sides. Use a for loop to create a figure with four subplots, showing a triangle in the first subplot, a square in the second subplot, a pentagon in the third subplot, and a hexagon in the fourth subplot. You should use the function you created in part (a) to draw each polygon. Use the index parameter from the for loop to specify the subplot in which each polygon is drawn, and in an expression to determine the number of sides used its input to the polygon function.Explanation / Answer
(a)
(b) for s=3:6
subplot(4,1,s-2)
polygon(s)
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.