DMelt:JMathlab/4 Commands

From jWork.ORG
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents

Commands

Name Option Description
format short displayformat for floatingpoint numbers: 5 digits, all digits or in BASE with COUNT digits.
- long -
- BASE COUNT -
syms $sym_1$ [$,sym_2,\ldots$] declare $sym_1,\ldots$ as symbolic variable.
clear $var_1$ [$,var_2,\ldots$] delete variables $var_1,\ldots$
who - display all variables
path - show searchpath
addpath path add to searchpath
hold - lock/unlock graphic window
hold on lock graphic window
hold off unlock graphic window

Define

Type Example O-Mode Example M-Mode
Number -3.214e-12 -3.214e-12
Vector [1 2 3 4] [1,2,3,4]
Matrix [1 2 ; 3 4] matrix([1,2],[3,4])
Vectorelement x(2) x[2]
Matrixelement x(2,1) x[2,1]
Range 2:5 -
Variable x = 2.321 x : 2.321;


Calculate

This table shows operators with one example each for Octave-mode (O-mode) and Maxima-mode (M-mode). Operations are executed according to their precedence (prec), and, if these are equal, in order.

Function O-Mode M-Mode Prec Order
Addition x + y x + y 4 left-right
Subtraction x - y x - y 4 left-right
Scalar Multiplication x .* y x * y 3 left-right
Vector/Matrix Multiplication x * y x . y 3 left-right
Scalar Division x ./ y 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
x ^ y
1 left-right
Vector/Matrix Exponentiation
x ^ y
x ^^ y
1 left-right
Range x:y:z - 5 left-right
Assignment x = z x : y 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 ++x 10 left-right
Predecrement --x --x 10 left-right
Postincrement x++ x++ 10 right-left
Postdecrement x-- x-- 10 right-left
Adjunct x' - 1 right-left
Factorial x! - 1 left-right


Comparison and Logical Operators

Function O-Mode M-Mode Prec Order
Less x < y x < y 6 left-right
Less or equal x <= y x <= y 6 left-right
Larger x > y x > y 6 left-right
Larger or equal x >= y x >= y 6 left-right
Equal x == y x == y 6 left-right
Not equal x ~= y x ~= y 6 left-right
And x & y x & y 7 left-right
Or
x  ||  y
x  ||  y
9 left-right
Not ~x ~x 8 left-right
More information on this topic is in DMelt books