MagicPlot Manual

Plotting and nonlinear fitting software

User Tools

Site Tools


expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
expressions [Tue Jan 12 20:21:29 2021]
Alexander
expressions [Sat Jan 16 17:25:32 2021] (current)
Alexander
Line 32: Line 32:
 ==== Using Spaces and Line Breaks ==== ==== Using Spaces and Line Breaks ====
 You can freely insert space characters and line breaks in formula, but do not break function names, numbers, operators. You do not need to enter special characters to indicate line break. You can freely insert space characters and line breaks in formula, but do not break function names, numbers, operators. You do not need to enter special characters to indicate line break.
 +
 +===== Local variables in expression =====
 +
 +You can set a local variables in expression. Use semicolon to separate variable assignments and the result expression: ''a=5; a*a + 2*a + 1''. The expression after the last semicolon is the result expression. The variables are calculated in the present order so you need to assign the variable before usage.
  
 ===== Functions ===== ===== Functions =====
Line 120: Line 124:
   * ''(-3)^2'' returns ''9''.   * ''(-3)^2'' returns ''9''.
   * ''2^2^3'' is equal to ''2^(2^3)'', because ''^'' is right-associative operator. The result is ''256''.   * ''2^2^3'' is equal to ''2^(2^3)'', because ''^'' is right-associative operator. The result is ''256''.
 +
 +===== Comments in formulas =====
 +
 +You can insert comments in any formula using ''/*…*/'' notation.
 +
 +Press ''Ctrl+/'' on Windows/Linux or ''Cmd-/'' on Mac OS to comment selection. Comments can be multi-line. Note that the single line comments using a symbol at the line start are not supported because line breaks are not taken into account in MagicPlot formula syntax.
  
expressions.1610472089.txt.gz · Last modified: Tue Jan 12 20:21:29 2021 by Alexander