MATLAB String Operations and File I/O Flashcards
6 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 6 MATLAB String Operations and File I/O flashcards as text
Which MATLAB function concatenates two strings?
Answer: strcat
strcat concatenates character arrays or string arrays, removing trailing whitespace from character array inputs.
How do you convert a number to a string in MATLAB?
Answer: num2str(x)
num2str converts a numeric value to a character array representation of that number.
What function reads a text file line by line in MATLAB?
Answer: fgetl
fgetl reads one line from a file and removes the newline character, returning -1 at end of file.
Which MATLAB function searches for a pattern in a string and returns its position?
Answer: strfind
strfind returns the starting indices of all occurrences of a pattern within a string.
What does `textscan` do in MATLAB?
Answer: Reads formatted data from a string or file into a cell array
textscan reads formatted data from a string or file, parsing it into a cell array according to format specifiers.
Which function in MATLAB reads a CSV file into a table?
Answer: readtable
readtable reads a CSV or other delimited text file and returns a MATLAB table object with column headers.