12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

plt(x,f(x/2),’--’)Let us try calling oops to delete more than one object. (We use a stringcell array in the following call to text to label the two curves at once.)x = -1:.01:1;f = inline(’x.^2’);clfplt(x,f(x),x,sqrt(f(x)))xt = [-.5 -.5];yt = [f(-.5) sqrt(f(-.5))];text(xt,yt,{’ |x|’ ’ x^2’})Now get rid <strong>of</strong> the misplaced labels <strong>and</strong> try again:oops(2)text(xt,yt,{’ x^2’ ’ |x|’})Example: Figure PositioningIn this example we suppose that we want to set up some windows foran application that will have two graphics displays <strong>and</strong> a graphical userinterface. We want the two output displays to occupy the bottom half<strong>of</strong> the screen <strong>and</strong> the GUIshould occupy the top left-h<strong>and</strong> corner. Weuse get <strong>and</strong> set to control the position <strong>of</strong> our figures. Let us create afigure <strong>and</strong> get its “position” property:figureget(gcf,’position’)ans =291 445 560 420But what do these numbers mean? To find out we need to get the units<strong>of</strong> measurement <strong>of</strong> this position:>> get(gcf,’units’)ans =pixelsHmm ... . What are the available units <strong>of</strong> measurement?c○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!