A MATLAB workspace initially contains exactly three scalar double variables: trial = 4, total = 10, and ans = 2. Match each command sequence to its resulting workspace state and displayed output. Run each sequence independently from this initial state. Semicolons suppress assignment output.
Only total = 10 and ans = 2 remain; the initial variable names were listed before removal.
All three variables remain, with total = 14; previous Command Window text is erased, and no new result is printed.
Only trial = 3 remains, and no new result is printed.
Only trial = 4 and ans = 2 remain; the initial variable names, sizes, and classes were listed before removal.
All three variables exist afterward with trial = 4, total = 10, and ans = 14; the sum is displayed.
clear ans; trial + total
who; clear trial;
whos; clear total;
clear; trial = 3;
clc; total = trial + total;
Unlock full course notes by signing up
Trace names and stored values
A student records force readings in newtons and enters the following MATLAB commands in order. The initial clear removes all previously stored variables.
Complete the table at each indicated checkpoint. Enter exact integers for stored values, all in newtons, or the word absent if the variable does not exist. Treat load_N and Load_N as distinct names.
Check proposed sensor variable names
A laboratory team proposes six names for variables in MATLAB. Classify each name by entering valid or invalid in the table. Judge whether MATLAB permits the name, even when using it might interfere with an existing function. All names are short enough to satisfy MATLAB's name-length limit.
Translate a calibration formula correctly
A pressure sensor produces a reading of 6.8 V. Its calibration offset is 0.8 V and its scale is 0.4 V/kPa. The pressure calculation should subtract the offset from the reading before dividing by the scale:
You enter the following commands in the MATLAB Command Window:
Recover an input from a preserved result
An engineering student calculates stress as force divided by area, using newtons, square metres, and pascals. The student enters these MATLAB commands in order:
Which statements correctly describe the final workspace or a proposed recovery calculation? Select every correct statement, evaluating each proposed recovery independently from this final state.