Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/smongo/tutorial_5.html
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 16:28:59 2012
Кодировка:

Поисковые слова: столовая гора
The SM Tutorial - How do I define variables, and how can I use them?

Go to the previous, next section.

How do I define variables, and how can I use them?

Scalar variables are defined with the define command. As mentioned above, vectors are defined with the set command. A variable may be a number, or a character string. You may use them in any SM command, by preceding the name of the variable with a $. For example:

        define 2PI 6.283
        set x=1,100
        do i = 0, 2, .01 {
           set x[$i] = $i * $2PI
        }
        set i=0, 2 , .01 set x=$2PI*i
        set y = sin(x)
        limits x y
        box
        define xlab {my signal2
        xlabel $xlab
        ylabel sine

Go to the previous, next section.