Tracing echoed output and workspace values

A student saves the script below as wall_heat.m. With an empty workspace, the student runs it by typing wall_heat at the prompt. The script computes the conduction heat flow through a brick wall from q=kA ΔT/Lq = kA\,\Delta T/L.


MATLAB
k = 0.8;            % thermal conductivity, W/(m K)
A = 12              % wall area, m^2
L = 0.25;           % wall thickness, m
dT = 20 - (-5)      % inside minus outside temperature, K
q = k*A*dT/L;       % heat flow, W
q_kW = q/1000       % heat flow, kW


For each variable, enter its value in the workspace after the run as an exact decimal. Then enter yes if MATLAB echoes that assignment to the Command Window, or no if it does not.

VariableValue after the runEchoed (yes or no)
k
A
L
dT
q
q_kW

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 MATLAB Scripts (M-files) Questions: