LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript symbols

two questions:
 
is there an symbol to continue an expression on the next line?
 
are there symbols for elementwise addition, subtraction etc?
 
Thanks
0 Kudos
Message 1 of 2
(6,837 Views)
Hello,

In order to continue an expression on the next line, use the ellipsis.  For example,
A = [1 2 ...
3 4]

is the same as
A = [1 2 3 4]

If you are writing code in the Script Editor or the MathScript node, you will have no problem.  In the Command Window of the MathScript Window, you will need to press shift+enter to go to a new line instead of immediately executing the current code.

For your second question, addition and subtraction are always performed elementwise.  Multiplication, division, and exponentiation can be done elementwise or as a matrix operation.  The elementwise operator is formed by prepending a period to the matrix operator.  For example
A .* B

For more information about the operators, type "help matrixops" in the MathScript Window.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 2 of 2
(6,835 Views)