ELG 3120 Lab 2 - PowerPoint PPT Presentation

About This Presentation
Title:

ELG 3120 Lab 2

Description:

ELG 3120 Lab 2 TAs Wei Zhang Ozgur Ekici (Section A) (Section B) Plotting functions Line Plots of 3-D Data The 3-D analog of the plot function is plot3. – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 10
Provided by: WEI1153
Category:
Tags: elg | azimuth | lab

less

Transcript and Presenter's Notes

Title: ELG 3120 Lab 2


1
ELG 3120 Lab 2
  • TAs
  • Wei Zhang Ozgur Ekici
  • (Section A) (Section B)

2
Plotting functions
3
  • Line Plots of 3-D DataThe 3-D analog of the plot
    function is plot3. If x, y, and z are three
    vectors of the same length,
  • plot3(x,y,z)
  • generates a line in 3-D through the points
    whose coordinates are the elements of x, y, and z
    and then produces a 2-D projection of that line
    on the screen.

4
  • Setting the Viewpoint with Azimuth and
    ElevationAzimuth and Elevation
  • The view command specifies the viewpoint by
    defining azimuth and elevation with respect to
    the axis origin. Azimuth is a polar angle in the
    x-y plane, with positive angles indicating
    counter-clockwise rotation of the viewpoint.
    Elevation is the angle above (positive angle) or
    below (negative angle) the x-y plane.

5
(No Transcript)
6
  • Axis Labels and Titles
  • The xlabel, ylabel, and zlabel commands add x-,
    y-, and z-axis labels. The title command adds a
    title at the top of the figure.
  • Example
  • xlabel(second')
  • ylabel('sin(t)')
  • title('Graph of the sine function')

7
  • Setting Axis Limits
  • By default, MATLAB finds the maxima and minima of
    the data to choose the axis limits to span this
    range.
  • The axis command enables you to specify your own
    limits
  • axis(xmin xmax ymin ymax)
  • or for three-dimensional graphs,
  • axis(xmin xmax ymin ymax zmin zmax)
  • Use the command
  • axis auto
  • to reenable MATLAB automatic limit selection.

8
  • Multiple Plots in One Figure
  • The subplot command enables you to display
    multiple plots in the same window or print them
    on the same piece of paper. Typing
  • subplot(m,n,p)
  • partitions the figure window into an m-by-n
    matrix of small subplots and selects the pth
    subplot for the current plot. The plots are
    numbered along first the top row of the figure
    window, then the second row, and so on. For
    example, these statements plot data in four
    different subregions of the figure window.

9
  • Example
  • t 0pi/102pi
  • X,Y,Z cylinder(4cos(t)) subplot(2,2,1)
  • mesh(X)
  • subplot(2,2,2)
  • mesh(Y)
  • subplot(2,2,3)
  • mesh(Z)
  • subplot(2,2,4)
  • mesh(X,Y,Z)
Write a Comment
User Comments (0)
About PowerShow.com