• Home
  • Textbooks
  • MATLAB Programming for Engineers
  • Handle Graphics

MATLAB Programming for Engineers

Stephen J.Chapman

Chapter 9

Handle Graphics - all with Video Answers

Educators


Chapter Questions

03:55

Problem 1

What is meant by the term handle graphics? Sketch the hierarchy of MATLAB graphics objects.

Jennifer Stoner
Jennifer Stoner
Numerade Educator
02:07

Problem 2

Use the MATLAB Help Browser to learn about the same and Number Title properties of a $f$ igure object. Create a figure containing a plot of the function $y(x)=e^{x}$ for $-2 \leq x \leq 2$. Change the properties mentioned above to suppress the figure number and to add the title "Plot Window" to

James Kiss
James Kiss
Numerade Educator
06:32

Problem 3

Write a program that modifies the default figure color to orange and the default line width to $3.0$ points. Then create a figure plotting the ellipse defined by the equations
$$
\begin{aligned}
&x(t)=10 \cos t \\
&y(t)=6 \sin t
\end{aligned}
$$
from $t=0$ to $t=2 \pi$. What color and width was the resulting line?

Melody Smiley
Melody Smiley
Numerade Educator
00:47

Problem 4

Use the MATLAB Help Browser to learn about the Current Point property of an axes object. Use this property to create a program that creates an axes object and plots a line connecting the locations of successive mouse elicks within the axes. Use the function wait forbuttonpress to wait for mouse clicks, and update the plot after each click. Terminate the program when a keyboard press occurs.

Charles Carter
Charles Carter
Numerade Educator
01:04

Problem 5

Create a MATLAB program that plots the functions
$$
\begin{aligned}
&x(t)=\cos \frac{t}{\pi} \\
&x(t)=2 \sin \frac{t}{2 \pi}
\end{aligned}
$$
for the range $-2 \leq t \leq 2$. The program should then wait for mouse clicks, and if the mouse has clicked onfone of the two lines, the program should change the line's color randomly from a choice of red, green, blue, yellow,cyan, magenta, or black. Use the function wait forbut tonpress to wait for mouse clicks, and update the plot after each click. Use the function gco to determine the object clicked on, and use the Type property of the object to determine if the click was on a line.

Carson Merrill
Carson Merrill
Numerade Educator
01:04

Problem 6

Create a MATLAB figure and store some user-defined data values in the figure. Then, save the figure in a figure file (*. fig) using the File/Save As menu option on the Figure Window, Next close down and restart MATLAB. Reload the figure using the File/Open menu option on a Figure Window, and try to recover the user-defined data using the getappdata function. Was the information preserved?

Deborah Ferry
Deborah Ferry
Numerade Educator