diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-11-07 16:52:00 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-11-07 16:52:00 +0000 |
commit | 9e6500bf8e925b363e74e01834f81dde0810f808 (patch) | |
tree | a720c1e446944f649b2f21d619bf35b34411a072 /examples/experiments/speed.m | |
parent | 894344f9ef93a0ff5e2fb12f085b5c706b7aa9d9 (diff) |
removed -O for 6.8.1
Diffstat (limited to 'examples/experiments/speed.m')
-rw-r--r-- | examples/experiments/speed.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/experiments/speed.m b/examples/experiments/speed.m new file mode 100644 index 0000000..2f41665 --- /dev/null +++ b/examples/experiments/speed.m | |||
@@ -0,0 +1,21 @@ | |||
1 | #! /usr/bin/octave -qf | ||
2 | 1; % measuring Octave computing times | ||
3 | |||
4 | function r = rot(a) | ||
5 | c = cos(a); | ||
6 | s = sin(a); | ||
7 | r = [ c , 0, s; | ||
8 | 0, 1, 0; | ||
9 | -s, 0, c]; | ||
10 | end | ||
11 | |||
12 | t0=time(); | ||
13 | x = linspace(0,1,1E5); | ||
14 | ac = eye(3); | ||
15 | for a = x | ||
16 | ac = ac*rot(a); | ||
17 | end | ||
18 | |||
19 | format long | ||
20 | disp(ac); | ||
21 | printf("%.2f seconds\n",time()-t0) | ||