{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

This preview shows pages 1–14. Sign up to view the full content.

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

View Full Document
ENCMP 100 2 ©2011 by ECE, UofA Overview Assign a handle to plots and adjust properties using handle graphics Learn how MATLAB handles three different types of image files Plots & Images
ENCMP 100 3 ©2011 by ECE, UofA Plotting Objects In MATLAB the plotting information is organized in a hierarchical way: figure – basic plotting object, can contain a number of different objects axes – are contained inside the figure; think of the axes as being layered on top of the figure window; the axes also can contain a number of different objects plot objects – drawn on top of the axes Plots & Images

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

View Full Document
ENCMP 100 4 ©2011 by ECE, UofA Plotting Objects figure axes layered on the top of the figure plot drawn on the axes Plots & Images
ENCMP 100 5 ©2011 by ECE, UofA Plotting Object Properties Object properties are special values associated with and objet that control some aspect of how that object behaves. Each property has a property name (usually a string) and an associated value When object is created all of it properties are automatically initialized to default values Plots & Images

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

View Full Document
ENCMP 100 6 ©2011 by ECE, UofA Plotting Procedure When plot function is invoked MATLAB automatically creates a figure an appropriate axis draws the graph (plot) on the axis MATLAB uses default values for many of the plot object properties. For example the first line drawn is always blue, unless the user specifically changes it. Plots & Images
ENCMP 100 7 ©2011 by ECE, UofA Object Handles A handle is a “nickname” given to an object in MATLAB We can assign a handle to Individual plots The figure window The axis on which we draw the plots Plots & Images

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

View Full Document
ENCMP 100 8 ©2011 by ECE, UofA Plot Handle Assigning a plot a name (or a handle) allows us to easily ask MATLAB to list the plot object properties. >>x = 1:100; >>y = x.^2; >>p_handle = plot(x,y) The variable p_handle is the handle of the plot. Plots & Images
ENCMP 100 9 ©2011 by ECE, UofA Plot Handle: example Plots & Images

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

View Full Document
ENCMP 100 10 ©2011 by ECE, UofA Function get The get function can be used to examine at any time the values of properties: value = get(p_handle, ‘Property name’); >> value = get(p_handle,’LineWidth’) value = 0.5000 >> value = get(p_handle,'color’) value = 0 0 1 Plots & Images
ENCMP 100 11 ©2011 by ECE, UofA Plot Handle: get example >> get(p_handle) DisplayName: '' Annotation: [1x1 hg.Annotation] Color: [0 0 1] LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerSize: 6 MarkerEdgeColor: 'auto' MarkerFaceColor: 'none' XData: [1x100 double] YData: [1x100 double] ZData: [1x0 double] Plots & Images

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

View Full Document
ENCMP 100 12 ©2011 by ECE, UofA Figure Handle We can also specify a handle name for the figure window. For the window named figure 1: >> f_handle = figure(1) If you have not specify a handle name, you can ask MATLAB to determine the current figure with the gcf (get current figure) command Plots & Images
ENCMP 100 13 ©2011 by ECE, UofA Figure Handle >> f_handle = figure(1) >> get(f_handle) % or get(gcf) Alphamap = [ (1 by 64) double array] CloseRequestFcn = closereq Color = [0.8 0.8 0.8] Colormap = [ (64 by 3) double array] CurrentAxes = [174.01] CurrentCharacter = CurrentObject = [] CurrentPoint = [0 0] DockControls = on FileName = Plots & Images

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}