<< Chapter < Page Chapter >> Page >
This module covers basic operations in LabVIEW MathScript.

Basic operations on numbers

LABVIEW MATHSCRIPT has many arithmetic operations and functions built in. Most of them arestraightforward to use. The Table below lists some commonly used scalar operations; in this table, x and y are scalars. (A scalar is a single number.)

Common scalar mathematical operations in labview mathscript
Operation LABVIEW MATHSCRIPT
x y x-y
x y x+y
x y x*y
x y x/y
x y x^y
e x exp(x)
log10 x log10(x)
ln x log(x)
log2 x log2(x)

Expressions are formed from numbers, variables, and these operations. The operations have different precedences. The ^ operation has the highest precedence; ^ operations are evaluated before any other operations. Multiplication and division have the next highest precedence, and addition and subtraction have the lowest precedence. Precedence is altered by parentheses; expressions within parenthesesare evaluated before expressions outside parentheses.

The Table below shows several mathematical formulas, the corresponding LABVIEW MATHSCRIPT expressions, and the values that LABVIEW MATHSCRIPT would compute for the expressions.

Example labview mathscript expressions
formula LABVIEW MATHSCRIPT Expression Computed Value
5 2 4 2 5^2+4^2 41
5 4 2 (5+4)^2 81
2 3 4 5 (2 + 3)/(4 - 5) -5
log10 100 log10(100) 2
ln 4 2 3 log(4*(2+3)) 2.9957

Basic operations on matrices

In addition to scalars, LABVIEW MATHSCRIPT can operate on matrices. Some common matrix operations are shown in the Table below; in this table, M and N are matrices.

Common matrix mathematical operations in labview mathscript
Operation LABVIEW MATHSCRIPT
M N M*N
M -1 inv(M)
M T M'
det( M ) det(M)

LABVIEW MATHSCRIPT functions length and size are used to find the dimensions of vectors and matrices, respectively.

LABVIEW MATHSCRIPT can perform an operation on each element of a vector or matrix. To perform an arithmetic operation on each element in a vector (or matrix), rather than on the vector (matrix) itself, then the operator should be preceded by".", e.g .* , .^ and ./ .

Let A 1 1 1 1 . Then A^2 will return AA 2 2 2 2 , while A.^2 will return 1 2 1 2 1 2 1 2 1 1 1 1 .

Given a vector x, compute a vector y having elements y n 1 x n . This can be easily be done in LABVIEW MATHSCRIPT by typing y=1./sin(x) Note that using / in place of ./ would result in the (common) error Matrix dimensions must agree .

Complex numbers

LABVIEW MATHSCRIPT has excellent support for complex numbers with several built-in functions available. The imaginaryunit is denoted by i or (as preferred in electrical engineering) j . To create complex variables z 1 7 and z 2 2 e simply enter z1 = 7 + j and z2 = 2*exp(j*pi)

The Table below gives an overview of the basic functions for manipulating complex numbers, where z is a complex number.

Manipulating complex numbers in labview mathscript
LABVIEW MATHSCRIPT
Re( z ) real(z)
Im( z ) imag(z)
z abs(z)
Angle( z ) angle(z)
z * conj(z)

Other useful details

  • A semicolon added at the end of a line tells LABVIEW MATHSCRIPT to suppress the command output to the display.
  • LABVIEW MATHSCRIPT Version 1.0 is case sensitive for both variables and functions; for example, b and B are different variables and LABVIEW MATHSCRIPT will recognize the built-in function sum but not SUM . In previous versions, LABVIEW MATHSCRIPT was not case sensitive for function names.
  • Often it is useful to split a statement over multiple lines. To split a statement across multiple lines, enter three periods ... at the end of the line to indicate it continues on the next line.

Splitting y a b c over multiple lines. y = a... + b...c;

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to labview mathscript. OpenStax CNX. Aug 06, 2006 Download for free at http://cnx.org/content/col10370/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to labview mathscript' conversation and receive update notifications?

Ask