Company: Mathworks mcq

Difficulty: medium

Problem Statement

MATLAB must pick between several same-named items when resolving a call. Rank the following in the order MATLAB actually checks them: (1) Nested function within current function, (2) Imported package function, (3) Functions in current folder, (4) Private functions. 1, 2, 3, 4 1, 4, 3, 2 2, 1, 4, 3 4, 3, 2, 1 Take the file A.m with the contents shown below: function x = A x = 0; function B x = 1; y = 1; end function C x = 2; y = 2; end end function y = D(y) y = y*y; end Counting separate scoped instances, how many distinct variables named 'x' and how many named 'y' exist here (case-insensitive 'X' and 'Y' in MATLAB context often refers to the specific instances in these scopes)? x: 1, y: 1 x: 2, y: 2 x: 3, y: 3 x: 4, y: 4 Suppose a MATLAB function you wrote gives numerically correct results but runs unacceptably slowly. Which tools would help pinpoint the specific lines responsible for the slowdown? (Select all that apply) 'tic' and 'toc' statements 'start' and 'stop' statements 'timer'

More Mathworks mcq OA questionsInterview experiences