~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/octave/contract/runme.m

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-20 18:33:37 UTC
  • mfrom: (1.2.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620183337-hockvwcewu29409c
Tags: 1.3.35-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - Force a few environment variables.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# file: runme.m
 
2
 
 
3
example 
 
4
 
 
5
# Call our gcd() function
 
6
 
 
7
x = 42;
 
8
y = 105;
 
9
g = example.gcd(x,y);
 
10
printf("The gcd of %d and %d is %d\n",x,y,g);
 
11
 
 
12
# Manipulate the Foo global variable
 
13
 
 
14
# Output its current value
 
15
printf("Foo = %f\n", example.cvar.Foo);
 
16
 
 
17
# Change its value
 
18
example.cvar.Foo = 3.1415926;
 
19
 
 
20
# See if the change took effect
 
21
printf("Foo = %f\n", example.cvar.Foo);
 
22