How Can I Call a .m Script in LabVIEW?

Updated Aug 21, 2023

Reported In


  • LabVIEW
  • LabVIEW MathScript Module

Issue Details

I have an script written in MATLAB® and I want to know the methods available to call it from LabVIEW and which one is the fastest one.


There are several ways to call a .m script in LabVIEW.
  • MATLAB® Script Node in LabVIEW uses ActiveX to call the MATLAB® runtime system. 
  • Note: NI does not recommend LabVIEW MathScript Module functions for new designs. See for information and recommended alternatives.
  • LabVIEW MathScript RT Module runs separately from The MathWorks, Inc. MATLAB® software.
  • Call MATLAB.exe, or a built executable, from LabVIEW using the System Exec VI.
As with any software, speed is relative to your application.  You will want to benchmark your application to ensure it meets your requirements.  If it is not meeting your requirements, benchmark another option to determine which is fastest for your specific application.

Additional Information

MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc.