Menu

Expression types

Type Description Input Example
Integer integer numbers 42
Rational rational numbers 13/17
Complex complex numbers 2+I*1/3
Real double values 0.5
Complex Real complex double values 0.5-I*0.25
Evaluation Precedence control precedence with (...) (a+b)*c
Lists comma separated list of elements which are surrounded by { ... } {a, b, c, d}
Vectors vectors are like list, but cannot contain sub-lists { ... } {1, 2, 3, 4}
Matrices a matrix contains the rows as sub-lists {{1, 2}, {3, 4}}
Sparse Arrays sparse arrays are defined through their element positions SparseArray({{1, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 3} -> 4})
Associations comma separated list of rules which are surrounded by <| ... |> and create a dictionary or map <|a->x, b->y, ...|>
Predefined Functions predefined function names start with an upper case character and the arguments are enclosed by ( ... ) Sin(0), PrimeQ(13)
Predefined Constants predefined constant names start with an upper case character Degree, E, Pi, False, True, ...
User-defined variables identifiers which you would like to assign a value start with a <span><span class="ML__latex"><span class="ML__strut" style="height:0.75em"></span><span class="ML__strut--bottom" style="height:1em;vertical-align:-0.25em"></span><span class="ML__base"><span class="ML__cmr">‘</span><span class="ML__mathit">cha</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">acte</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">inthese</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit" style="margin-right:0.04em">v</span><span class="ML__mathit">e</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">en</span><span class="ML__mathit" style="margin-right:0.04em">v</span><span class="ML__mathit">i</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">onment</span><span class="ML__cmr">∣‘</span></span></span></span>a=42
User-defined variables in the Symja console app user-defined variables can be defined without a preceding <span><span class="ML__latex"><span class="ML__strut" style="height:0.75em"></span><span class="ML__strut--bottom" style="height:1em;vertical-align:-0.25em"></span><span class="ML__base"><span class="ML__cmr">‘</span><span class="ML__mathit">cha</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">acte</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__cmr">∣‘</span><span class="ML__mathit">a</span><span style="display:inline-block;width:0.28em"></span><span class="ML__cmr">=</span><span style="display:inline-block;width:0.28em"></span><span class="ML__cmr">42‘∣∣</span><span class="ML__mathit" style="margin-right:0.11em">U</span><span class="ML__mathit">se</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span style="display:inline-block;width:0.23em"></span><span class="ML__cmr">−</span><span style="display:inline-block;width:0.23em"></span><span class="ML__mathit">de</span><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__mathit">ined</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">u</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">es</span><span class="ML__cmr">∣</span><span class="ML__mathit">identi</span><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__mathit">ie</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">s</span><span class="ML__mathit" style="margin-right:0.03em">w</span><span class="ML__mathit">hich</span><span class="ML__mathit" style="margin-right:0.04em">y</span><span class="ML__mathit">ou</span><span class="ML__mathit" style="margin-right:0.03em">w</span><span class="ML__mathit">ou</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">d</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">i</span><span class="ML__mathit" style="margin-right:0.04em">k</span><span class="ML__mathit">etoassi</span><span class="ML__mathit" style="margin-right:0.04em">g</span><span class="ML__mathit">na</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">u</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">esta</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">t</span><span class="ML__mathit" style="margin-right:0.03em">w</span><span class="ML__mathit">itha</span><span class="ML__cmr">‘</span></span></span></span> character in the server environment <span><span class="ML__latex"><span class="ML__strut" style="height:0.75em"></span><span class="ML__strut--bottom" style="height:1.11em;vertical-align:-0.35em"></span><span class="ML__base"><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__cmr">(</span><span class="ML__mathit">x</span><span class="ML__msubsup"><span class="ML__vlist-t ML__vlist-t2"><span class="ML__vlist-r"><span class="ML__vlist" style="height:-0.07em"><span style="top:-2.85em;margin-right:0.05em"><span class="ML__pstrut" style="height:3em"></span><span style="height:0.21em;display:inline-block;font-size: 70%"><span class="ML__cmr">,</span></span></span></span><span class="ML__vlist-s">​</span></span><span class="ML__vlist-r"><span class="ML__vlist" style="height:0.29em"></span></span></span></span><span class="ML__mathit" style="margin-right:0.04em">y</span><span class="ML__msubsup"><span class="ML__vlist-t ML__vlist-t2"><span class="ML__vlist-r"><span class="ML__vlist" style="height:0.35em"><span style="top:-2.81em;margin-right:0.05em"><span class="ML__pstrut" style="height:3em"></span><span style="height:0.7em;display:inline-block;font-size: 70%"><span class="ML__cmr">)</span></span></span></span><span class="ML__vlist-s">​</span></span><span class="ML__vlist-r"><span class="ML__vlist" style="height:0.36em"></span></span></span></span><span style="display:inline-block;width:0.28em"></span><span class="ML__cmr">:=</span><span style="display:inline-block;width:0.28em"></span><span class="ML__mathit">x</span><span class="ML__cmr">,</span><span style="display:inline-block;width:0.17em"></span><span class="ML__mathit" style="margin-right:0.04em">y</span><span class="ML__cmr">‘∣∣</span><span class="ML__mathit" style="margin-right:0.11em">U</span><span class="ML__mathit">se</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span style="display:inline-block;width:0.23em"></span><span class="ML__cmr">−</span><span style="display:inline-block;width:0.23em"></span><span class="ML__mathit">de</span><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__mathit">ined</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">u</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">es</span><span class="ML__cmr">∣</span><span class="ML__mathit">inthe</span><span class="ML__mathit" style="margin-right:0.06em">S</span><span class="ML__mathit" style="margin-right:0.04em">y</span><span class="ML__mathit">m</span><span class="ML__mathit" style="margin-right:0.06em">j</span><span class="ML__mathit">aconso</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">eappuse</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span style="display:inline-block;width:0.23em"></span><span class="ML__cmr">−</span><span style="display:inline-block;width:0.23em"></span><span class="ML__mathit">de</span><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__mathit">ined</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">u</span><span class="ML__mathit" style="margin-right:0.02em">l</span><span class="ML__mathit">escanbede</span><span class="ML__mathit" style="margin-right:0.11em">f</span><span class="ML__mathit">ined</span><span class="ML__mathit" style="margin-right:0.03em">w</span><span class="ML__mathit">ithoutap</span><span class="ML__mathit" style="margin-right:0.03em">r</span><span class="ML__mathit">ecedin</span><span class="ML__mathit" style="margin-right:0.04em">g</span><span class="ML__cmr">‘</span></span></span></span> character
Pattern Symbols patterns end with an appended _ character and could have a constraint $f(x_Integer):={x}
Strings character strings are enclosed by double quote characters "Hello World"
Pure Functions pure functions can be expressed with the & operator (#^3)&[x] gives x^3
Slots a # character followed by an optional integer number # or #2
Slot Sequences a # character followed by an optional integer number ## or ##2
Parts of an expression expr[[index]] {a, b, c, d}[[2]] gives b
Feedback
Tell us anything that can be improved