← 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 a delimited text file and returns a table?

    Answer: readtable

    readtable reads delimited text files (CSV, TSV, etc.) and returns a MATLAB table object with column names detected automatically.

  2. What does the MATLAB function 'importdata' return when loading a CSV file with a header row?

    Answer: A struct with fields 'data', 'textdata', and 'colheaders'

    importdata returns a struct containing numeric data in 'data', text content in 'textdata', and column headers in 'colheaders' when the file has mixed content.

  3. Which colormap in MATLAB transitions from blue through green to yellow to red?

    Answer: jet

    The 'jet' colormap is the classic rainbow colormap that transitions blue → cyan → green → yellow → red.

  4. What is the purpose of the 'hold on' command in MATLAB?

    Answer: Retains the current plot so subsequent plots are added to it

    'hold on' prevents the current axes from being cleared when a new plot command is executed, allowing multiple datasets on one axes.

  5. Which function creates a histogram in MATLAB?

    Answer: histogram

    The 'histogram' function (introduced in R2014b) creates histograms with automatic bin selection and returns a Histogram object, superseding the older 'hist' function.

  6. How do you specify that 'readtable' should treat '#' as a comment character when importing a text file?

    Answer: readtable('file.txt','CommentStyle','#')

    The 'CommentStyle' name-value pair in readtable tells the parser to ignore any line beginning with the specified character.

  7. What does 'xlim([0 10])' do in a MATLAB plot?

    Answer: Sets the x-axis display range from 0 to 10

    xlim sets the limits of the x-axis on the current axes to the specified two-element vector [xmin xmax].