Lec6ex - Lecture Examples (9/11) function...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture Examples (9/11) function DrawRect(a,b,L,W,c) % Adds a rectangle to the current window. % Assumes hold is on. % The rectangle has vertices (a,b), (a+L,b), (a+L,b+W), % and (a,b+W) and color c where c is one of 'r', 'g', 'y', etc. function DrawDisk(xc,yc,r,c) % Adds a circular disk to the current window. % Assumes hold is on. % The disk has radius r, center(xc,yc) and % color c where c is one of 'r', 'g', 'y', etc. function DrawStar(xc,yc,r,c) % Adds a 5-pointed star to the current window. % Assumes hold is on. % The star has radius r, center(xc,yc) and % color c where c is one of 'r', 'g', 'y', etc. % Script ShowAll % Illustrates DrawRect, DrawDisk, and DrawStar close all figure axis equal off hold on DrawRect(-1,-1,2,2, 'k' ) DrawDisk(0,0,1, 'm' ) DrawStar(0,0,1, 'y' ) hold off shg
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
% Script StarArray % Draws a blue 12-by-6 rectangle with lower left % corner at (0,0), % and then white radius 1 stars with centers at % % (2,4), (4,4), (6,4), (8,4) (10,4) % (2,2), (4,2), (6,2), (8,2) (10,2)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Lec6ex - Lecture Examples (9/11) function...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online