How Can I Run a MathWorks, Inc. MATLAB® Script That Uses MATLAB® Toolboxes in LabVIEW?

Updated Sep 17, 2020

Reported In

Software

  • LabVIEW MathScript Module
  • LabVIEW

Issue Details

I am trying to execute a code I have written in MATLAB® on LabVIEW, with the Mathscript Node, but some functions are not recognized, and the node throw me errors.
What should I do ?

Solution

The reason why it is not recognized is that you must use, in this case, the MATLAB® Script Node (right) rather that Mathscript Node (left).
MATLAB® Script Node in LabVIEW uses ActiveX to call the MATLAB® runtime system while LabVIEW MathScript RT Module runs separately from The MathWorks, Inc. MATLAB® software.

You can find the MATLAB® Script Node in Mathematics >> Scripts & Formulas >> Script Nodes :







 

Additional Information

It is also possible to call the the MATLAB.exe, or a built executable, from LabVIEW using the System Exec VI.

Note: NI does not recommend LabVIEW MathScript Module functions for new designs. See www.ni.com/migratemathscript for information and recommended alternatives.