← All MATLAB Flashcard Decks

Data Import and Visualization 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 Data Import and Visualization flashcards as text
  1. Which MATLAB function reads data from a specific sheet of an Excel workbook?

    Answer: readmatrix('file.xlsx','Sheet','Sheet2')

    readmatrix (and readtable/readcell) accept the 'Sheet' name-value pair to specify which worksheet to read from a multi-sheet Excel file.

  2. What is the primary difference between 'plot' and 'scatter' in MATLAB?

    Answer: scatter allows per-point color and size control while plot uses uniform line style

    scatter lets you specify individual marker sizes and colors as vectors, making it ideal for visualizing a third or fourth variable through marker attributes.

  3. Which function saves a MATLAB figure to a PNG file?

    Answer: All of the above are valid

    All three methods—exportgraphics, saveas, and print—can export a MATLAB figure to PNG, though exportgraphics (R2020a+) offers the most control over resolution and tight bounding boxes.

  4. What does 'tiledlayout(2,3)' do in MATLAB?

    Answer: Creates a 2-row by 3-column grid of axes tiles in the current figure

    tiledlayout (R2019b+) creates a layout manager for arranging multiple axes in a figure; 'nexttile' then places each axes in the next available cell.

  5. When using 'fread' to read binary data, what does the 'precision' argument control?

    Answer: The data type of each value read from the file

    The precision argument in fread specifies the data type (e.g., 'int16', 'float32', 'uint8') of each element to be read from the binary file.

  6. What MATLAB function retrieves the names of variables stored in a .mat file without loading them into memory?

    Answer: whos('-file','data.mat')

    whos('-file','filename') returns information about variables in a MAT-file including their names, sizes, and types without loading the data.

  7. Which MATLAB function creates a filled contour plot?

    Answer: contourf

    contourf creates a filled contour plot where the regions between contour lines are filled with color, unlike contour which draws only the lines.