-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput_file.m
61 lines (50 loc) · 986 Bytes
/
input_file.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function input_file
%INPUT_FILE A test input file for strip_delimited.py.
%#{
fprintf('Picking random number.\n')
%#}
x = getRandomNumber;
fprintf('The number chosen is %i.\n', x)
end
function x = getRandomNumber
%GETRANDOMNUMBER Get a random number. Source: http://xkcd.com/221/.
x = 4; % Chosen by fair dice roll. Guaranteed to be random.
%#ifdef VERBOSE
fprintf('Generating number. The result is guaranteed to be random.\n')
%#endif
%#ifndef VERBOSE
fprintf('Generating number.\n')
%#endif
%#ifdef TEST
assert(x == 4, 'x is not 4.');
%#endif
%#ifdef VERBOSE
fprintf('Assertion passed.\n')
%#endif
%#ifndef VERBOSE
fprintf('\n')
%#endif
%#{
fprintf('x = %i\n', x)
%#}
%#ifdef OUTER
%#ifdef INNER
fprintf('OUTER and INNER.\n')
%#endif
%#endif
%#ifndef OUTER
%#ifdef INNER
fprintf('INNER only.\n')
%#endif
%#endif
%#ifdef OUTER
%#ifndef INNER
fprintf('OUTER only.\n')
%#endif
%#endif
%#ifndef OUTER
%#ifndef INNER
fprintf('Neither OUTER nor INNER.\n')
%#endif
%#endif
end