Q:

Write a script that will display rectangles with varying curvatures and line widths, as shown in the Figure. The script will, in a loop, create a 2 by 2 subplot showing rectangles

0

Write a script that will display rectangles with varying curvatures and line widths, as shown in the Figure. The script will, in a loop, create a 2 by 2 subplot showing rectangles. In all, both the x and y axes will go from 0 to 1.4. Also, in all, the lower left corner of the rectangle will be at (0.2, 0.2), and the length and width will both be 1. The line width, i, is displayed in the title of each plot. The curvature will be [0.2, 0.2] in the first plot, then [0.4, 0.4], [0.6,0.6], and finally [0.8,0.8].  

Figure 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ch12Ex21.m

% Display a 2 by 2 subplot of rectangles with

% varying curvatures and line widths

for i = 1:4

 subplot(2,2,i)

 rectangle('Position',[0.2 0.2 1 1], ...

 'LineWidth', i, ...

 'Curvature', [0.2*i 0.2*i])

 axis([0 1.4 0 1.4])

 title(sprintf('Line Width is %d', i))

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now