File: script.mdc

package info (click to toggle)
freemat 4.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 141,800 kB
  • ctags: 14,082
  • sloc: ansic: 126,788; cpp: 62,046; python: 2,080; perl: 1,255; sh: 1,146; yacc: 1,019; lex: 239; makefile: 100
file content (48 lines) | stat: -rw-r--r-- 1,164 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

 Usage

A script is a sequence of FreeMat commands contained in a .m
file. When the script is called (via the name of the file),
the effect is the same as if the commands inside the script
file were issued one at a time from the keyboard. Unlike
function files (which have the same extension, but have a
function declaration), script files share the same
environment as their callers. Hence, assignments, etc, made
inside a script are visible to the caller (which is not the
case for functions.


 Example

Here is an example of a script that makes some simple
assignments and printf statements.

       tscript.m


  a = 13;
  printf('a is %d\n',a);
  b = a + 32

If we execute the script and then look at the defined
variables

  --> tscript
  a is 13

  b =
   45

  --> who
    Variable Name       Type   Flags             Size
                a    double                    [1x1]
              ans    double                    [0x0]
                b    double                    [1x1]

we see that a and b are defined appropriately.

* FreeMat_Documentation
* Functions_and_Scripts
* Generated on Thu Jul 25 2013 17:17:14 for FreeMat by
  doxygen_ 1.8.1.1