该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


infix (with arguments on either side, such as + in 3 + 4, or = in a = 7)
prefix (with one argument on its right side, such as !a for logical negation)
or postfix (with one argument on its left side, such as a++ for incrementing a
The assignment operation can be written either as the Assign() function or as an infix operator =. Similarly, subtraction can be done with the Subtract() function or the infix minus sign; they are equivalent inside JMP.
Another common operator is the semicolon ( ; ). You use the semicolon to:
So b * c is evaluated first, and then the result is added to a.
+ takes precedence over -:
So b * c is evaluated, and then the result is added to a. d is then subtracted from the result of a + b * c.
Operators and Their Function Equivalents in Order of Precedence shows operators shaded in order of precedence and each operator’s function equivalent.
{a,b}
List(a,b)
a[b,c]
Subscripts identify specific elements within a data element a, where a could be a list, a matrix, a data column, a platform object, a display box, and so on.
a++
Adds one (1) to a, in place.
a– –
a^b
Power(a,b)
Raise a to exponent power b. With only one argument, 2 is assumed as the power, so Power(x) computes x2.
!a
a*b
a:*b
EMult(a,b)
Elementwise multiplication for matrices a and b. (Each element in matrix a is multiplied by each element in matrix b.)
a/b
Divide(a, b) divides a by b.
Divide(x) interprets the argument as a denominator and implies 1 as the numerator, yielding the reciprocal 1/x.
a:/b
EDiv(a,b)
Elementwise division for matrices a and b. (Each element in matrix a is divided by each element in matrix b.)
a+b
Add(a,b)
Adds a and b.
ab
Subtracts b from a.
a||b
matrix1|/matrix2
VConcat(matrix1, matrix2)
Vertically concatenate matrices. (Use || or Concat() to horizontally concatenate matrices.)
a::b
Index(a,b)
(Colons are also used as prefix operators for scoping, where :a means data table column a, and ::a means JSL global variable a. See Scoping Operators for details.)
Send(object, message)
Send message to object.
a==b
Equal(a,b)...
Boolean values for comparisons. They all return 1 if true, 0 if false. Missing values in either a or b causes a return value of missing, which evaluates as neither true nor false. See Missing Values, for treatment of missing values.
a!=b
Not Equal(a,b)...
a<b
Less(a,b)...
a<=b
a>b
a>=b
a<=b<c
a<b<=c
a&b
And(a,b)
a|b
Or(a,b)
a=b
Put the value of b into a. Replaces the current value of a.
a+=b
AddTo(a,b)
a– =b
Subtract b from a, and put back into a.
a*=b
Multiply b with a, and put back into a.
a/=b
Divide b into a, and put back into a.
a;b
Glue(expr, expr, ...)
First do a, and then do b.