MATLAB - MATLAB Technical Computing Practice Test

FREE MATLAB Functions and Flow Control Questions and Answers

Free · Instant Results

A function `calculateArea` is defined as follows: ```matlab function area = calculateArea(width, height) if nargin == 1 % Assume a square if only one input is given height = width; end area = width * height; end ``` What is the output of the command `calculateArea(5)`?
▶ Start Practice Test