A pump technician has saved batchVolume.m in MATLAB's current folder. Its saved contents are:
flowRate = 2.4; duration = 50; volume = flowRate * duration;
The flow rate is in millilitres per second, the duration is in seconds, and the calculated volume is in millilitres.
In the MATLAB Editor, the technician replaces the first two lines with flowRate = 3.2; and duration = 45;, leaving the last line unchanged. These edits remain unsaved, and automatic saving is disabled throughout this task.
The technician then performs these actions in order, without using the Editor's Run button:
There are no other workspace changes or naming conflicts.
Determine the volume at checkpoint A in mL, the duration at checkpoint B in s, and the volume at checkpoint C in mL. Give all three answers to one decimal place.
Unlock full course notes by signing up
Initialization across repeated runs
A laboratory technician compares two MATLAB scripts that update a recorded liquid volume. Script A contains:
Script B contains:
For each script, start a separate trial with volume_mL equal to 100. Run that entire script twice, without changing variables between its runs. Reset the starting value to 100 before beginning the other script's trial.
Workspace values after interrupted execution
Before a MATLAB script runs, the base workspace contains work_J = 9 and status_code = 0. The name missing_distance_m is undefined: no variable or callable file with that name exists. The saved script contains:
The entire script is run once with no error-handling code. Which statements describe the workspace after MATLAB reports the error? Select all that apply.
Assignments hidden inside comments
A technician uses the following MATLAB script to calculate a measurement rate. The workspace is empty before the technician runs the entire script once.
Complete the table for the state after execution. Enter exact integers for numerical values and yes or no for the existence check. The duration is measured in seconds, and the rate is measured in readings per minute.
Two runs with changing voltage inputs
An engineer tests a MATLAB script that adjusts a voltage reading. Initially, the base workspace contains offset_V = 0.1 and raw_V = 2.4. The saved file contains:
Run the entire saved script twice, with no intervening commands or edits. Determine the corrected voltage immediately after the first run, the corrected voltage immediately after the second run, and the offset immediately after the second run. Answer all three quantities in volts, to one decimal place.