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
Which MATLAB function reads a JSON file and converts it to a MATLAB structure?
Answer: jsondecode(fileread('data.json'))
MATLAB has no single jsonread function; the standard pattern is fileread() to get the raw text then jsondecode() to parse it into a struct.
What does 'subplot(2,2,3)' specify in MATLAB?
Answer: The axes in the bottom-left position of a 2x2 grid
subplot(m,n,p) selects axes number p in an m-by-n grid; positions are numbered left-to-right, top-to-bottom, so position 3 is bottom-left in a 2x2 grid.
What is the purpose of 'detectImportOptions' in MATLAB?
Answer: Automatically detects and returns configurable import options for a file
detectImportOptions inspects a file and returns an ImportOptions object pre-configured for that file, which you can then modify before passing to readtable or readmatrix.
Which property of a MATLAB line object controls the thickness of the plotted line?
Answer: LineWidth
The LineWidth property (in points) controls the rendered thickness of line and marker edge strokes on a MATLAB plot object.
What does 'yyaxis right' do in MATLAB?
Answer: Activates the right y-axis so subsequent plot commands use it
yyaxis right switches the active y-axis to the right side; subsequent plot commands will be associated with the right y-axis scale.
When would you use 'readlines' instead of 'readtable' in MATLAB?
Answer: When reading a plain text file as an array of string lines without parsing structure
readlines reads a text file and returns each line as a string in a string array, useful for unstructured text, logs, or files you intend to parse manually.
Which MATLAB function converts a datetime array to a numeric format suitable for plot axis ticks?
Answer: datenum
datenum converts a datetime or date string to a serial date number (days since Jan 0, 0000), which MATLAB's older plotting functions use for date-based axes.