summaryrefslogtreecommitdiff
path: root/examples/experiments/speed.m
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-07 16:52:00 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-07 16:52:00 +0000
commit9e6500bf8e925b363e74e01834f81dde0810f808 (patch)
treea720c1e446944f649b2f21d619bf35b34411a072 /examples/experiments/speed.m
parent894344f9ef93a0ff5e2fb12f085b5c706b7aa9d9 (diff)
removed -O for 6.8.1
Diffstat (limited to 'examples/experiments/speed.m')
-rw-r--r--examples/experiments/speed.m21
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
21; % measuring Octave computing times
3
4function r = rot(a)
5 c = cos(a);
6 s = sin(a);
7 r = [ c , 0, s;
8 0, 1, 0;
9 -s, 0, c];
10end
11
12t0=time();
13x = linspace(0,1,1E5);
14ac = eye(3);
15for a = x
16 ac = ac*rot(a);
17end
18
19format long
20disp(ac);
21printf("%.2f seconds\n",time()-t0)