LabVIEW ships with the MATLAB script node. You can find it in the Mathematics >> Scripts & Formulas >> Script Nodes palette. I am not aware of any limitations in using your existing code in this manner. You do need to have The MathWorks, Inc. MATLAB® software installed in order to use the MATLAB script node. There may be a slight delay in transferring your data to the MATLAB software from LabVIEW, but if your code is performing a large operation, the delay is negligible compared to your computation time.
Alternatively, you can use LabVIEW MathScript. In LabVIEW MathScript, you generally can execute scripts written in the MATLAB language syntax. However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports.
The MathScript node can be used on your LabVIEW diagrams. You can find it in the Programming >> Structures palette. You can also use the interactive MathScript window to run code that you have created. You can launch the MathScript Window from the Tools menu in LabVIEW. By default, the MathScript search path uses your "My Documents\LabVIEW Data" directory. If you place any of your .m files in that location, they will be found by MathScript. LabVIEW MathScript does not require any third-party software to be installed.
The speed of execution largely depends on what your code does. Using the MATLAB script node, the MATLAB software will execute your code. LabVIEW MathScript is written on top of LabVIEW code, so it will never be faster than the equivalent operation in native LabVIEW code. In general, if your code is vectorized and you don't see any warning glyphs on the MathScript node, your code should run decently fast.
MATLAB® is a registered trademark of The MathWorks, Inc.
Grant M. Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments