function output = testSwitch()
% TESTSWITCH is a function to demonstrate false "incorrect indentation"
% warnings. Returns OUTPUT.
randomInt = 2; % Decided by fair dice roll
switch(randomInt)
case 1
output = 1;
case 2
output = 2;
case 3
output = 3;
otherwise
output = 'four'; % Uh oh, unlucky number
end
end
>> check testSwitch.m
Code Analysis for testSwitch.m
Required files: testSwitch.m
Required toolboxes: MATLAB
Function testSwitch (Line 1, col 19):
Number of lines: 17 (good)
Number of function arguments: 0 (good)
Number of used variables: 2 (good)
Max level of nesting: 2 (good)
Code complexity: 4 (good)
Line 8, col 1: incorrect indentation
Line 9, col 1: incorrect indentation
Line 10, col 1: incorrect indentation
Line 11, col 1: incorrect indentation
Line 12, col 1: incorrect indentation
Line 13, col 1: incorrect indentation
Line 14, col 1: incorrect indentation
Line 15, col 1: incorrect indentation