I have several MATLAB scripts running in my LabVIEW VI via MATLAB script nodes, and one of them in particular slows by program down considerably. It dawned on me that I could just take the slowest commands in the script, place them in a script node running a separate VI, and run the two VIs in parallel. It seems it doesn't work that way, though - my main program runs a little faster than it did before, but I only get a major speed increase when I stop the second VI.
I realized a long time ago that two VIs running in parallel share the same MATLAB environment and can even address the same variables, but it never occurred to me that I couldn't actually run two MATLAB scripts at the same time - and that seems to be the case.
What would be the best way around this limitation? Is there some way I can force the two VIs to use separate MATLAB environments? (There's plenty of resouces available on the computer, so I'm not particularly worried about inefficiency.) Would compiling the VIs or compiling the scripts somehow help?