Skip to content Skip to navigation

Connexions

You are here: Home » Content » A Very Brief Introduction to Programming in LabVIEW MathScript

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "Introduction to LabVIEW MathScript"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection: "Introduction to LabVIEW MathScript"

    Comments:

    "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 […]"

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • NI Signal Processing display tagshide tags

    This module is included inLens: Digital Signal Processing with NI LabVIEW and the National Instruments Platform
    By: Sam ShearmanAs a part of collection: "Introduction to LabVIEW MathScript"

    Comments:

    "Tutorial / Introduction to LabVIEW MathScript, a text-based component of National Instruments LabVIEW that allows you to run your .m file scripts in LabVIEW Virtual Instruments."

    Click the "NI Signal Processing" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
Download
x

Download module as:

  • PDF
  • EPUB (what's this?)

    What is an EPUB file?

    EPUB is an electronic book format that can be read on a variety of mobile devices.

    Downloading to a reading device

    For detailed instructions on how to download this content's EPUB to your specific device, click the "(what's this?)" link.

  • More downloads ...
Reuse / Edit
x

Module:

Add to a lens
x

Add module to:

Add to Favorites
x

Add module to:

 

A Very Brief Introduction to Programming in LabVIEW MathScript

Module by: Anthony Antonacci. E-mail the author

Based on: A Very Brief Introduction to Programming in MATLAB by Darryl Morrell

Summary: This module gives a very brief introduction to some of the concepts behind programming in LabVIEW MathScript using m-file syntax.

You can use LABVIEW MathScript code to automate computations. Almost anything typed at the command line can also be included in a LABVIEW MathScript program. Lines in a LABVIEW MathScript script are interpreted sequentially and the instructions are executed in turn. This simplifies repetitive computations. This allows you to create complex computations that cannot be readily implemented using commands at the command line. You can also create computational capabilities for other people to use.

LABVIEW MATHSCRIPT scripts are text files and can be edited by any text editor. Any script should run the same on any computer running LABVIEW MATHSCRIPT regardless of its operating system. Script files must have an extension of ".m" and be in a directory that LABVIEW MATHSCRIPT knows about.

LABVIEW MATHSCRIPT scripts interact with the current LABVIEW MathScript environment. Variables set before the script is executed can affect what happens in the script. Variables set in the script remain after the script has finished execution.

One way to edit LABVIEW MATHSCRIPT scripts is to use the built-in editor. The editor has some features that make editing LABVIEW MATHSCRIPT scripts easier. The editor is integrated with the debugger which makes finding and correcting errors in your scripts easier. More detailed information about editing scripts can be found at National Instruments LabVIEW MathScript Tutorial-Inside LabVIEW MathScript Tutorial.

Use comments to remind you and help other users understand how you have implemented your program. Comments begin with the character %.

For LABVIEW MATHSCRIPT to correctly execute a script, it must know the directory in which the script resides. There are several ways to do this. One is to set the current working directory for LABVIEW MATHSCRIPT from the File>MathScript Preferences in the MathScript interactive window. More detailed information can be found at National Instrument's LabVIEW MathScript Preferences Dialog Box.

M-file names should begin with a letter and only contain letters and numbers. Any other characters (space, dash, star, slash, etc.) will be interpreted by LABVIEW MATHSCRIPT as operations on variables and will cause errors. Also, M-file names should not be the same as variables in the workspace, since LABVIEW MATHSCRIPT will not be able to differentiate between the file name and the variable.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Reuse / Edit:

Reuse or edit module (?)

Check out and edit

If you have permission to edit this content, using the "Reuse / Edit" action will allow you to check the content out into your Personal Workspace or a shared Workgroup and then make your edits.

Derive a copy

If you don't have permission to edit the content, you can still use "Reuse / Edit" to adapt the content by creating a derived copy of it and then editing and publishing the copy.