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:


MATLAB
offset_V = offset_V + 0.2;
corrected_V = raw_V - offset_V;
raw_V = 3;


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.

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: