You are a guest. Restricted access. Read more

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
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

Comparison and Logical Operators

Function O-Mode Prec Order
Less x < y 6 left-right
Less or equal x ⇐ y 6
jmathlab/operators.txt · Last modified: 2013/04/14 16:52 (external edit)
Back to top
CC Attribution-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0