10-09-2013 06:45 PM
How about calling matlab from a system exec.vi?
10-09-2013 06:53 PM
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?
10-09-2013 08:34 PM
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)
10-14-2013 05:27 AM
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:
i found one link to a successfull matlab node script application here:
cheers,
laurens
10-14-2013 06:28 PM
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
10-14-2013 06:56 PM
Oh, right - I knew I forgot something: you can execute a .m file by path inside the script node.