LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Efficeint calling of MATLAB scripts that call subfunctions

I am looking to call some MATLAB code using the MATLAB Script Node in LabVIEW. The problem is I cannot get the script to call subfunctions. Specifically, I want to use the "fmincon" function for a constrained optimization problem. I can write the objective function inline, however the nonlinear constraints need to be specified as a function .m file. This does not seem to execute correctly (or at all) using the MATLAB script node from LabVIEW. I also understand that I can call MATLAB using the System Exec .vi, however, how would I input/output the information without reading/writing text files? This seems ungainly. Compilation into a DLL may be possible, but I am unfimilar with the process and do not have m
uch time to work on this. Is there a way I can get subfunctions to execute? Thanks.
0 Kudos
Message 1 of 4
(3,556 Views)
Hi

I never encountered this kind of problem with Mathlab.

Maybe you should try to redefine the path of your .m file.

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 2 of 4
(3,556 Views)
Thanks, all this thrashing around and I completely forgot to change the MATLAB root directory to access my subfunctions.
0 Kudos
Message 3 of 4
(3,557 Views)
What did you change your root directory to?
I'm trying to load some .mat files from the script node and having very little success.
The files are in my C:\MATLAB6p1\work directory.
I wonder where the script node looks by default when building a VI...
I have seen that executables can specify a directory during the build process, but
any help would be useful at this point.
0 Kudos
Message 4 of 4
(3,460 Views)