← 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 stem plot (discrete sequence plot)?

    Answer: stem

    stem(x,y) plots data as vertical lines (stems) topped with markers, commonly used to visualize discrete-time signals.

  2. How do you rotate a 3D plot interactively in MATLAB's figure window?

    Answer: Use the 'rotate3d on' command or the Rotate 3D toolbar button

    'rotate3d on' enables interactive 3D rotation so you can click and drag the plot to view it from different angles.

  3. What does 'caxis([0 100])' do in MATLAB?

    Answer: Sets the color data limits used by the colormap to map values 0–100

    caxis([cmin cmax]) sets the color axis scaling so that the colormap spans the data range from cmin to cmax.

  4. Which MATLAB function is used to add a secondary y-axis on the right side of a plot?

    Answer: yyaxis right

    yyaxis right activates the right y-axis so subsequent plots are drawn against it while sharing the same x-axis.

  5. In MATLAB, what is the difference between 'plot(x,y)' and 'fplot(@(x) sin(x), [0 pi])'?

    Answer: fplot adaptively samples the function for accuracy while plot uses fixed x-spacing

    fplot adaptively samples the function at more points in rapidly changing regions to produce a smoother and more accurate curve, unlike plot which uses fixed spacing.

  6. Which MATLAB command saves the current figure as a high-resolution PNG file?

    Answer: print('-dpng','-r300','fig.png')

    print('-dpng','-r300','fig.png') exports the current figure as a PNG with 300 DPI resolution, suitable for publication.

  7. What does the MATLAB function 'polarplot(theta, rho)' create?

    Answer: A 2D plot in polar coordinates with angle theta and radius rho

    polarplot(theta, rho) draws a line in polar coordinates, where theta is the angle in radians and rho is the radius.