PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/octave/functor/runme.m

#
Objective C | 18 lines | 12 code | 6 blank | 0 comment | 1 complexity | a015d69e23edfa4b8aefc51242dd6b69 MD5 | raw file
 1# Operator overloading example
 2example
 3
 4a = example.intSum(0);
 5b = example.doubleSum(100.0);
 6
 7# Use the objects.  They should be callable just like a normal
 8# python function.
 9
10for i=0:100-1,
11    a(i);           # Note: function call
12    b(sqrt(i));     # Note: function call
13endfor
14
15a.result()
16b.result()
17
18