Discard or capture a returned load

A test technician saves this function as adjustedLoad.m in MATLAB's current folder. Both inputs and the returned load represent forces in newtons.


MATLAB
function force = adjustedLoad(force, increment)
    force = force + increment;
end


The technician then executes these commands in order in the Command Window:


MATLAB
force = 120;
adjustedLoad(force, 15);
afterDiscard = force;
force = adjustedLoad(force, 25);
afterCapture = force;


Complete the table with the final values of afterDiscard and afterCapture. Enter exact integers in newtons. All inputs are ordinary numeric scalars.

VariableFinal force (N)
afterDiscard
afterCapture

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 User Defined Functions and Function Files Questions: