Based on: Variables in MATLAB by Darryl Morrell
Summary: This module provides a brief introduction to the use of variables in LabVIEW MathScript.
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
A variable in LABVIEW MATHSCRIPT is a named value. Using variables allows us to manipulate values symbolically, which is particularly useful when programming.
Suppose we wish to compute the circumference of a circle of diameter 5 units using the formula
d to a value of 5:
>> d = 5
d =
5.000
c:
>> c = pi*d
c =
15.708
d
(which LABVIEW MATHSCRIPT knows because we earlier set it to 5) and the value of pi (which is a pre defined variable in LABVIEW MATHSCRIPT) and stores the value of the product in the variable c.
Variable names must begin with an upper- or lower-case letter. They may contain letters, digits, and underscores; they may not contain spaces or punctuation characters. LABVIEW MATHSCRIPT is case sensitive, so A and a are different variables.
Which of the following are valid variable names?
a B ecky_ecky_ecky_ecky_ptang_zoo_boing ecky ecky ecky ecky ptang zoo boing 2nd John-BigbooteLABVIEW MATHSCRIPT has several predefined variables. The most commonly used include
ans - the default variable in which computation results are stored. pi - π. i or j -
clear command.
LABVIEW MATHSCRIPT variables can contain several types of numerical values. These types include the following:
c and d in Example 1 are scalar variables.
"This course provides a brief introduction to LabVIEW MathScript, the textual math componenet of LabVIEW. The modules for this course include typical syntax and programming methods commonly used […]"