Skip to content

Commit d25e4f4

Browse files
committed
created examples and fixed typos in readme
1 parent 5ca9411 commit d25e4f4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

EXAMPLES.mlx

6.11 KB
Binary file not shown.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ Class to define functions in a way that we can track the number of function eval
2424
See more examples in `Examples.mlx`.
2525

2626
```matlab
27-
# define the function
27+
% define the function
2828
f = @(x) x^2;
2929
30-
# new function handle that counts the number of function evaluations
31-
[f,count] = CountedFunction.count_function_calls(f)
30+
% new function handle that counts the number of function evaluations
31+
[f,count] = CountedFunction.count_function_calls(f);
3232
33-
# evaluates the function 1000 times
34-
for i = 1:1000;
33+
% evaluates the function 1000 times
34+
for i = 1:1000
3535
f(0);
3636
end
3737
38-
# prints the number of function evaluations
38+
% prints the number of function evaluations
3939
count()
4040
```
4141

@@ -47,12 +47,12 @@ ans =
4747

4848

4949
```matlab
50-
# evaluates the function another 1000 times
51-
for i = 1:1000;
50+
% evaluates the function another 1000 times
51+
for i = 1:1000
5252
f(0);
5353
end
5454
55-
# prints the number of function evaluations again
55+
% prints the number of function evaluations again
5656
count()
5757
```
5858

0 commit comments

Comments
 (0)