โ† All MATLAB Flashcard Decks

2D and 3D Plotting Flashcards

7 cards from real MATLAB practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 2D and 3D Plotting flashcards as text
  1. Which MATLAB function creates a quiver (vector field) plot?

    Answer: quiver

    quiver(x,y,u,v) draws arrows at (x,y) with direction and magnitude given by (u,v), used to visualize 2D vector fields.

  2. In MATLAB, how do you make a plot line semi-transparent with 50% opacity?

    Answer: Set the line handle's 'Color' property to include an alpha value: [r g b 0.5]

    In MATLAB, transparency for line objects is set via the Color property using a 4-element [R G B Alpha] vector where Alpha ranges from 0 (transparent) to 1 (opaque).

  3. What does the 'shading interp' command do to a surface plot in MATLAB?

    Answer: Removes the mesh lines and applies smooth color interpolation across each face

    'shading interp' removes the mesh edge lines and smoothly interpolates colors across each face using vertex color values.

  4. Which function in MATLAB plots a filled 2D polygon given vertex coordinates?

    Answer: fill

    fill(x,y,c) creates a filled 2D polygon by connecting the x and y coordinates and filling with color c.

  5. When using 'surf(X,Y,Z)' in MATLAB, what must be true about X, Y, and Z?

    Answer: X and Y must be 2D grids (from meshgrid) and Z must be a 2D matrix of the same size

    surf() requires X and Y to be 2D coordinate grids (typically from meshgrid) and Z to be a 2D matrix of the same size giving the height at each grid point.

  6. What is the purpose of 'view(az, el)' in MATLAB 3D plots?

    Answer: Sets the camera position using azimuth and elevation angles

    view(az, el) sets the viewpoint for 3D plots by specifying the azimuth (horizontal rotation) and elevation (vertical angle) in degrees.

  7. Which MATLAB command would you use to display a 2D matrix as an image with scaled color mapping?

    Answer: imagesc

    imagesc(C) displays matrix C as an image with the colormap scaled to span the full range of values in C.