Saved code, editor changes, and pump results

A pump technician has saved batchVolume.m in MATLAB's current folder. Its saved contents are:


MATLAB
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:

  1. In the Command Window, execute flowRate = 5;, duration = 10;, and volume = 7;, followed by batchVolume. Immediately afterward is checkpoint A.
  2. Save the edited script, without executing any commands. Immediately afterward is checkpoint B.
  3. Enter batchVolume again in the Command Window. Immediately afterward is checkpoint C.

There are no other workspace changes or naming conflicts.


A timeline shows unsaved editing followed by a first Command Window run, saving without execution, and a second Command Window run.


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.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Script Files Questions: