Environment and Syntax 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 Environment and Syntax flashcards as text
Which MATLAB environment panel lets you navigate the file system and open files without typing full paths?
Answer: Current Folder browser
The Current Folder browser provides a GUI file explorer that lets you browse directories and double-click files to open them.
What does `isa(x, 'double')` return if `x` is a single-precision array?
Answer: false (0)
`isa()` returns logical 1 only when the object belongs to exactly the specified class; `single` does not match `'double'`.
In the MATLAB Editor, what does Ctrl+Enter do (when the cursor is inside a Code Section)?
Answer: Runs only the current section (cell)
Ctrl+Enter executes the code section (cell) delimited by `%%` markers where the cursor is currently located.
What symbol creates a Code Section (cell) boundary in a MATLAB script?
Answer: %% (double percent)
Two consecutive percent signs `%%` at the start of a line define a section boundary in the MATLAB Editor.
What does `eps` represent in MATLAB?
Answer: Machine epsilon — the smallest difference between two double values
`eps` is the machine epsilon for double precision, approximately 2.22e-16, representing floating-point relative precision.
How do you concatenate two strings `s1` and `s2` in MATLAB (character array style)?
Answer: [s1 s2]
Horizontal concatenation with square brackets `[s1 s2]` joins character arrays directly; `strcat` also works but trims trailing whitespace.
What does the `inputname` function return when used inside a MATLAB function?
Answer: The workspace name of a variable passed as an argument
`inputname(n)` returns the variable name used by the caller for the n-th input argument, useful for generating informative error messages.