Well, it is not all MATLAB code/script that can run in LabVIEW by using MathScript.
If there is some IP (Intelectual Property) function in the code, that is, functions from any MATLAB Toolbox, you won't be able to run it using MathScript.
In fact, you should call the MATLAB script node in you code. This node invokes the MATLAB software script server to execute scripts written in the MATLAB language syntax, and are only available for windows.
Try coding it using the MATLAB script node and tell me if that worked for you.
Felipe Flores Application Engineer National Instruments Brazil