|
| 1 | +classdef MatlabIndentedClass |
| 2 | + %MATLABINDENTEDCLASS This is an example class for testing the |
| 3 | + % indentation check |
| 4 | + % |
| 5 | + % Some more comments to make the checker happy |
| 6 | + % Some more comments to make the checker happy |
| 7 | + % returns a new OBJ. |
| 8 | + |
| 9 | + % |
| 10 | + % |
| 11 | + properties(Access = private) |
| 12 | + foobar |
| 13 | + end |
| 14 | + |
| 15 | + methods(Access = protected) |
| 16 | + |
| 17 | + function output1 = foo_function(input1, input2) |
| 18 | + %FOO_FUNCTION This is an example function for testing the |
| 19 | + % indentation check |
| 20 | + % output1 = foo_function: input1, input2 |
| 21 | + % Some more comments to make the checker happy |
| 22 | + |
| 23 | + try |
| 24 | + input1 = 42; |
| 25 | + catch |
| 26 | + input2 = 42; |
| 27 | + end |
| 28 | + % Some more comments to make the checker happy |
| 29 | + if input1 |
| 30 | + output1 = 1; |
| 31 | + elseif input2 |
| 32 | + output1 = 2; |
| 33 | + else |
| 34 | + output1 = 0; |
| 35 | + end |
| 36 | + |
| 37 | + end |
| 38 | + |
| 39 | + function foobar = second_function(barfoo) |
| 40 | + %SECOND_FUNCTION This is an example function for testing the |
| 41 | + % indentation check |
| 42 | + % foobar, barfoo |
| 43 | + foobar = barfoo; |
| 44 | + end |
| 45 | + |
| 46 | + function varargout = variable_length_of_in_and_output(varargin) |
| 47 | + %VARIABLE_LENGTH_OF_IN_AND_OUTPUT is provided with input param |
| 48 | + % VARARGIN and output parameter VARARGOUT |
| 49 | + varargout = varargin; |
| 50 | + end |
| 51 | + |
| 52 | + function output = test_linebreak_with_continuation_operator(inputarg) |
| 53 | + %TEST_LINEBREAK_WITH_CONTINUATION_OPERATOR is a test to verify |
| 54 | + % line continuation operator |
| 55 | + % INPUTARG, OUTPUT |
| 56 | + |
| 57 | + assignment_at_first_line = ... |
| 58 | + inputarg; |
| 59 | + |
| 60 | + assignment_at_second_line = ... some comment |
| 61 | + assignment_at_first_line; |
| 62 | + |
| 63 | + output = .... 4 dots give also comment |
| 64 | + assignment_at_second_line; |
| 65 | + end |
| 66 | + |
| 67 | + function test_switch_case(inputarg) |
| 68 | + %TEST_SWITCH_CASE test indentation of switch case |
| 69 | + % INPUTARG |
| 70 | + % Some more comments to make the checker happy |
| 71 | + |
| 72 | + switch inputarg |
| 73 | + case 1 |
| 74 | + return |
| 75 | + case 2 |
| 76 | + return |
| 77 | + otherwise |
| 78 | + return |
| 79 | + end |
| 80 | + end |
| 81 | + end |
| 82 | +end |
0 commit comments