LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling Matlab GUI from Matlab Script Node causes Labview to terminate

How about calling matlab from a system exec.vi?

0 Kudos
Message 11 of 16
(716 Views)

yep, that would open matlab. but how would i run a script within matlab? i think matlab script node can do it.... anyone out there?

0 Kudos
Message 12 of 16
(715 Views)

http://www.mathworks.com/support/solutions/en/data/1-16B8X/

 

 

 

When running a script 'myfile.m', use the following command:


matlab -r myfile


When calling a function 'myfile.m' which accepts two arguments:


matlab -r myfile(arg1,arg2)

 

0 Kudos
Message 13 of 16
(707 Views)

yes this works.

 

and i am wondering if we can add a remote PC address to the path whenc calling matlab -r *.m file in the System Exec.vi. to run as administrator you can see how it is done here:

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Run-as-Administrator-Option-for-System-Exec-VI/idi-p/1...

 

i found one link to a successfull matlab node script application here:

 

http://lirycdtm.wordpress.com/2012/04/05/original原创a-useful-way-to-run-custom-defined-m-file-within-...

 

cheers,

laurens

0 Kudos
Message 14 of 16
(694 Views)

Hey laurens1976,

 

Can you give us a better idea of the issue you're encountering? I.E. A specific scenario of what you're trying to accomplish? Going back to your original question, if your goal is to run your .m script in The MathWorks, Inc. MATLAB® software, from within NI LabVIEW, then you'll want to use a MATLAB script node. Further information regarding this node, as well as where to find examples, can be found here:

 

MATLAB script

http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/matlab_script_node/

 

Any script placed within the MATLAB script node is called within an instance of the MATLAB software and the node communicates with MATLAB through ActiveX. So, this sounds like it fits the needs of your application.

 

MATLAB® is a registered trademark of The MathWorks, Inc.

 

Regards,

 

--Ryan_S

0 Kudos
Message 15 of 16
(680 Views)

Oh, right - I knew I forgot something: you can execute a .m file by path inside the script node.

0 Kudos
Message 16 of 16
(676 Views)