JMathLabTutorial:6 Commands and Operators

From jWork.ORG
Revision as of 20:08, 27 December 2016 by Jworkorg (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents

Commands and Operators

Commands are used for setting modes and options. In contrast to functions, arguments my be supplied without parenthesis. Only one command per text input is allowed.

format

short
long

display format for floatingpoint numbers: 5 digits, all digits or in BASE with COUNT digits.

syms

Declare symbolic variable. In some cases, one should assume that the code contains symbolic evaluation (like "rat" function). In this case you can keep this keyword but comment it out:


syms x
a=x*2
printf("%f",a)

clear

Clear a given variable from memory

who

Shows variables in the memory

path

Print all available functions

Operators

This table shows operators. Operations are executed according to their precedence (prec), and, if these are equal, in order.

Function Syntax Prec Order
Addition x + y 4 left-right
Subtraction x - y 4 left-right
Scalar Multiplication x .* y 3 left-right
Vector/Matrix Multiplication x * y 3 left-right
Scalar Division x ./ y 3 left-right
Matrix Division (right) x / y 3 left-right
Matrix Division (left) x \ y 3 left-right
Scalar Exponentiation
x .^ y
1 left-right
Vector/Matrix Exponentiation
x ^ y
1 left-right
Range x:y:z 5 left-right
Assignment x = z 10 right-left
Assignment x += z 10 right-left
Assignment x -= z 10 right-left
Assignment x /= z 10 right-left
Assignment x *= z 10 right-left
Preincrement ++x 10 left-right
Predecrement --x 10 left-right
Postincrement x++ 10 right-left
Postdecrement x-- 10 right-left
Adjunct x' 1 right-left
Factorial x! 1 left-right