LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Special Characters and Structures

For MathScript Nodes, I am trying to locate some Help for special characters and structures such as the proper ways of defining arrays, structures etc. and how and when to use ( ), { }, [ ], colons, commas, semicolons, etc. Can someone point me to this information? Thanks Jeff
0 Kudos
Message 1 of 5
(7,057 Views)
Hi Jeff,
 
You can find help topic about MathScript online. To learn about syntax of MathScript, you need to read through this page
 
Note that by now, you can not use n-dimensional array, cell array and structure in MathScript.
0 Kudos
Message 2 of 5
(7,050 Views)
Thanks for the help but unfortunately that was no more help than the Help information provided by LabView 8.5. I was looking for help on how to define arrrays, when to use [ ], ( ), { } and other special characters. MatLab use of these special characters are not quite the same as LabViews.
Also, I believe a 2D array is acceptable for the MathScript node. Correct me if I am wrong.
0 Kudos
Message 3 of 5
(7,039 Views)

Hi Jeff,

Yes, 2D array is acceptable in MathScript.

I will try to give detail about your question. If I miss anything, please let me know.

Define array - You should use [ ] to define and initialize an array. For example, A = [1 2 3; 4 5 6; 7 8 9] defines A to be a 3-by-3 matrix. Comma or space character separates element by element in one row. And, semicolon character separates row by row.

[ ] - Another situation to use [ ] is to define a function. You should use [ ] to specify output, such as function [a, b] = foo(g, h).

( ) - Parenthesis is widely used in MathScript. 1) In a formula, parenthesis gives high priority to calculations within it, such as a*(b+c); 2) It is used in function call, such as sin(a); 3) It is used to specify input when you define a function.

{ } - MathScript can not accept cell array by now. Therefore, { } is not used.

' ' - Single quotation is used to define a string variable, such as b = 'MathScript'.

; - Semicolon is used to separates row in matrix or end a command, such as c = sin(1);. If you end a command with semicolon, it suppress the display out in MathScript Window. This does not work in MathScript Node.

... - It is used to separate a long formula into two lines, such as
d = 1*...
(2+3)

 

0 Kudos
Message 4 of 5
(7,020 Views)
Thanks, that what I was looking for.
0 Kudos
Message 5 of 5
(7,010 Views)